I like to think of the IPv4 and the IPv6 internet as two separate, but interrelated, networks. This is because, without some sort of tunnel or encapsulation, a packet will either travel solely on the IPv4 internet, or solely on the IPv6 internet.
What I mean by “interrelated” is that, generally, a website on IPv6 will show the same content as the IPv4 website would for the same URL. The difference is purely in the IP addresses and routers used to pass packets to and from the website. This difference should be completely transparent to the users, but if you are configuring or testing a computer, then you need to be able to distinguish between the two.
Which will it use
As we are transitioning from IPv4 to IPv6, many machines will be on both networks, known as dual-stack. This generally works in the following way.
- The user types in a URL, say http://www.example.com/content
- The browser pulls out the machine name, in this case “www.example.com” and uses DNS to find an IP address.
- DNS initially attempts to resolve to an IPv6 address and, if found, is returned to the browser. The browser will then communicate with the server via IPv6.
- If no IPv6 address is found, then DNS attempts to resolve to an IPv4 address. The browser will then communicate with the server via IPv4.
This selection even works with the DNS itself, where DNS servers that list both IPv6 and IPv4 addresses will be queried by IPv6, and servers with only an IPv4 address will be queried by IPv4.
There are some situations where you can be using both IPv4 and IPv6, such as when a proxy is involved. My setup uses Squid proxy on a dual stack machine, so web browsers are able to connect to the proxy via IPv4, but the proxy may end up getting the web page over the internet using IPv6. Since this is actually two separate client/server connections, there is no issue with using different IP versions for each.
This can be useful to help you transition from 4 to 6 without needing to change everything over at once.
Checking IPv6 Availability
You can manually test the DNS queries by using the nslookup tool. “A” type queries are for IPv4 addresses, and “AAAA” queries are for IPv6 addresses. “set q=” allows you to change which query you are performing.
>nslookup Default Server: yourdns.example.com Address: 192.168.1.1 > set q=A > www.google.com Server: 192.168.1.1 Address: 192.168.1.1#53 Non-authoritative answer: Name: www.google.com Address: 22.214.171.124 > set q=AAAA > www.google.com Server: 192.168.1.1 Address: 192.168.1.1#53 Non-authoritative answer: www.google.com has AAAA address 2404:6800:4006:800::2004
This can show up some interesting “hex text” in the IPv6 addresses, for example…
- mirror.aarnet.edu.au includes “cafe::beef”
- facebook.com includes “face:booc”
Tools that use IPv6
To ping test IPv6 in linux, use the “ping6” utility as you would normally use “ping”. For Windows, use “ping -6” to force IPv6, or “ping -4” to force IPv4.
In a web browser, you can use an IPv4 address instead of the URL. For example, the following two will get to the same server
But for IPv6, you need to encapsulate the address in square brackets, such as…
Note that there are issues with most proxy autoconfig scripts recognising the square bracketed raw IPv6 address, however this isn’t a major issues as they are rarely used outside of testing.
To do more advanced testing (when you are running an internet accessible server, to check that your services are IPv6 accessible) see IPv6 Testing Tools
Also, Hurricane Electric’s free IPv6 certification system goes through many tests of your IPv6 enabled server as part of their certification process.