$line) { $line = trim($line, " \t\n\r\0\x0B"); if (substr($line, 0,1) == "#") { // Comment handling // ---------------------------------------------------------- // Change below me // ---------------------------------------------------------- $output .= $line; // Change this to match comments in youre services (default # starts comment if not changed) // ---------------------------------------------------------- // Change above me // ---------------------------------------------------------- } elseif (substr($line, 0,1) == "*") { // Wildcard handling change to match services // Output for wildcard // ---------------------------------------------------------- // Change below me // ---------------------------------------------------------- $line = ltrim($line, '*'); // Removing the * in the line $line = ltrim($line, '.'); // Removing the . in the line // Append to the output file // line is the corrent line in the file (domainname) $output .= "# ------ Wildcard replaced with local-zone data ------ #" . PHP_EOL; $output .= 'local-zone: "' . $line . '" redirect' . PHP_EOL; $output .= 'local-data: "' . $line . ' A ' . $server . '"' . PHP_EOL; $output .= "# ---------------------------------------------------- #"; // ---------------------------------------------------------- // Change above me // ---------------------------------------------------------- } else { // Single domain handling // ---------------------------------------------------------- // Change below me // ---------------------------------------------------------- $output .= 'local-data: "' . $line . ' A ' . $server . '"'; // ---------------------------------------------------------- // Change above me // ---------------------------------------------------------- } $output .= PHP_EOL; } $output .= PHP_EOL; $output .= PHP_EOL; } } if ($mode == "cli") { return $output; } else { echo $output; } } } ?>