#!/usr/bin/perl # This is QUICK AND DIRTY! use strict; use warnings; my $server_name = $ENV{SERVER_NAME} // 'ipv6test.f3s.buetow.org'; print < The Ultimate IPv6 Test Site Congratulations, you have connected to a server that will display your method of connection, either IPv6 (preferred) or IPv4 (old and crusty). Well IPv6 is already ~15 years old either but not as old as IPv4 ;)

Nevertheless, please choose your destiny: If your browser times-out when trying to connect to this server then you do not have an IPv6 or IPv4 path (depends on which test you are running) to the server. If your browser returns an error that the host cannot be found then the DNS servers you are using are unable to resolve the AAAA or A DNS record (depends on which test you are running again) for the server. If your browser is able to connect to the "IPv6 Only Test", yet using the "IPv6 & IPv4 Test" returns a page stating you are using IPv4, then your browser and/or IP stack in your machine are preferring IPv4 over IPv6. It also might be that your operating system supports IPv6 but your web-browser doesn't. END if ($server_name =~ /^ipv6test\.f3s\.buetow\.org$/) { print "

IPv6 & IPv4 Test Results (Dual Stack):

\n"; } elsif ($server_name =~ /^ipv6\.ipv6test\.f3s\.buetow\.org$/) { print "

IPv6 Only Test Results:

\n"; } elsif ($server_name =~ /^ipv4\.ipv6test\.f3s\.buetow\.org$/) { print "

IPv4 Only Test Results:

\n"; } elsif ($server_name eq 'ipv6.buetow.org') { print "

IPv6 & IPv4 Test Results:

\n"; } elsif ($server_name eq 'test6.ipv6.buetow.org') { print "

IPv6 Only Test Results:

\n"; } elsif ($server_name eq 'test4.ipv6.buetow.org') { print "

IPv4 Only Test Results:

\n"; } else { print "

Test Results:

\n"; } print "
You are using " . do {
	if ($ENV{REMOTE_ADDR} =~ /(?:\d+\.){3}\d/) {
		'IPv4'
	} else {
		'IPv6'
	}
} . "\n";


chomp (my $remote = `host $ENV{REMOTE_ADDR}`);
chomp (my $server = `host $ENV{SERVER_ADDR}`);
chomp (my $server0 = `host $ENV{SERVER_NAME}`);
chomp (my $digremote = `dig -x $ENV{REMOTE_ADDR}`);
chomp (my $digserver = `dig -x $ENV{SERVER_ADDR}`);
chomp (my $digserver0 = `dig -t any $ENV{SERVER_NAME}`);

print <Client address reverse DNS lookup:
$remote

Server address reverse DNS lookup:
$server

Server hostname DNS lookup:
$server0

Advanced client address reverse DNS lookup:
$digremote

Advanced server address reverse DNS lookup:
$digserver

Advanced server hostname DNS lookup:
$digserver0

Thanks for visiting, please recommend this test to your friends and colleagues. Any comments go to Paul Buetow. END