From 6f5cc58c21060a20a27ade4283df4963241fc5bd Mon Sep 17 00:00:00 2001 From: deepend Date: Thu, 11 Jan 2024 08:51:37 +0000 Subject: [PATCH] Update includes/main.php --- includes/main.php | 284 +++++++++++++++++++++++----------------------- 1 file changed, 142 insertions(+), 142 deletions(-) diff --git a/includes/main.php b/includes/main.php index ff0f241..4db3fb9 100644 --- a/includes/main.php +++ b/includes/main.php @@ -1,143 +1,143 @@ - 'Quebec, Canada', // Replace with actual locations - 'ns2' => 'Frankfurt, Germany', - 'ns3' => 'Sydney, Australia', - // Add more as needed - ]; - - if (file_exists($masterFile)) { - $content = file_get_contents($masterFile); - // Regex to match A records (IPv4) - preg_match_all('/(\S+)\s+IN\s+A\s+(\S+)/', $content, $aMatches); - // Regex to match AAAA records (IPv6) - preg_match_all('/(\S+)\s+IN\s+AAAA\s+(\S+)/', $content, $aaaaMatches); - - $ipv4Records = array_combine($aMatches[1], $aMatches[2]); - $ipv6Records = array_combine($aaaaMatches[1], $aaaaMatches[2]); - - foreach ($nsFilter as $nsName) { - $ipv4 = isset($ipv4Records[$nsName]) ? $ipv4Records[$nsName] : 'IPv4 not found'; - $ipv6 = isset($ipv6Records[$nsName]) ? $ipv6Records[$nsName] : 'IPv6 not found'; - $geographicalArea = isset($nsGeographicalAreas[$nsName]) ? $nsGeographicalAreas[$nsName] : 'Unknown Location'; - - $servers[] = [ - 'hostname' => $nsName, - 'ipv4' => $ipv4, - 'ipv6' => $ipv6, - 'location' => $geographicalArea - ]; - } - } - - return $servers; -} - -$dnsServers = getDnsServersInfo(); - -// Function to check server status -//function checkServerStatus($server) { - // Ping command varies depending on the operating system - // This is an example for a Unix-like system -// $output = []; -// $status = null; -// exec("ping -c 1 -W 5000 " . escapeshellarg($server), $output, $status); -// -// return $status === 0 ? "Online" : "Offline"; -//} -function checkServerStatus($server) { - $port = 53; // DNS port, change if necessary - $timeout = 5; // Timeout in seconds - - $fp = @fsockopen($server, $port, $errno, $errstr, $timeout); - - if ($fp) { - fclose($fp); - return "Online"; - } else { - return "Offline"; - } -} -?> - - - - - - |--===TildeNIC ===--| Bringing .tilde to the Tildeverse! - - - -
- -
- -
-

Welcome to TildeNIC

-
-

TildeNIC is where you can request your .tilde top level domain. To do so, you need to first change your DNS over to one of the resolvers we offer, or you can self-host one.

- -

NOTE! None of the servers currently listed are functional. They are old IP addresses. New servers will be online very soon!

-

- OpenNIC Information -

-

- Domains offered by OpenNIC are also able to be resolved using our servers, Such as: -

    -
  • .geek
  • -
  • .bbs
  • -
  • .gopher and more.
  • -
- Will all resolve using our dns servers. For more information about OpenNIC you can visit http://opennic.org -

-
- -
-

TildeNIC Available DNS Servers

-
    - -
  • - - - IPv4: , - IPv6: , - Location: - - - - -
  • - -
-
-
- + 'Quebec, Canada', // Replace with actual locations + 'ns2' => 'Frankfurt, Germany', + 'ns3' => 'Sydney, Australia', + // Add more as needed + ]; + + if (file_exists($masterFile)) { + $content = file_get_contents($masterFile); + // Regex to match A records (IPv4) + preg_match_all('/(\S+)\s+IN\s+A\s+(\S+)/', $content, $aMatches); + // Regex to match AAAA records (IPv6) + preg_match_all('/(\S+)\s+IN\s+AAAA\s+(\S+)/', $content, $aaaaMatches); + + $ipv4Records = array_combine($aMatches[1], $aMatches[2]); + $ipv6Records = array_combine($aaaaMatches[1], $aaaaMatches[2]); + + foreach ($nsFilter as $nsName) { + $ipv4 = isset($ipv4Records[$nsName]) ? $ipv4Records[$nsName] : 'IPv4 not found'; + $ipv6 = isset($ipv6Records[$nsName]) ? $ipv6Records[$nsName] : 'IPv6 not found'; + $geographicalArea = isset($nsGeographicalAreas[$nsName]) ? $nsGeographicalAreas[$nsName] : 'Unknown Location'; + + $servers[] = [ + 'hostname' => $nsName, + 'ipv4' => $ipv4, + 'ipv6' => $ipv6, + 'location' => $geographicalArea + ]; + } + } + + return $servers; +} + +$dnsServers = getDnsServersInfo(); + +// Function to check server status +//function checkServerStatus($server) { + // Ping command varies depending on the operating system + // This is an example for a Unix-like system +// $output = []; +// $status = null; +// exec("ping -c 1 -W 5000 " . escapeshellarg($server), $output, $status); +// +// return $status === 0 ? "Online" : "Offline"; +//} +function checkServerStatus($server) { + $port = 53; // DNS port, change if necessary + $timeout = 10; // Timeout in seconds + + $fp = @fsockopen($server, $port, $errno, $errstr, $timeout); + + if ($fp) { + fclose($fp); + return "Online"; + } else { + return "Offline"; + } +} +?> + + + + + + |--===TildeNIC ===--| Bringing .tilde to the Tildeverse! + + + +
+ +
+ +
+

Welcome to TildeNIC

+
+

TildeNIC is where you can request your .tilde top level domain. To do so, you need to first change your DNS over to one of the resolvers we offer, or you can self-host one.

+ +

NOTE! None of the servers currently listed are functional. They are old IP addresses. New servers will be online very soon!

+

+ OpenNIC Information +

+

+ Domains offered by OpenNIC are also able to be resolved using our servers, Such as: +

    +
  • .geek
  • +
  • .bbs
  • +
  • .gopher and more.
  • +
+ Will all resolve using our dns servers. For more information about OpenNIC you can visit http://opennic.org +

+
+ +
+

TildeNIC Available DNS Servers

+
    + +
  • + - + IPv4: , + IPv6: , + Location: - + + + +
  • + +
+
+
+ \ No newline at end of file