views:

31

answers:

2

Are there any well known addresses that can be resolved to well known IP addresses, preferably for both IPv4 and IPv6?

I'm playing with Berkeley Sockets and have written a class to encapsulate away the sockaddr_in stuff, and want to unit test it but don't know of any addresses that I can put in as test data that are guaranteed to resolve to specific IP addresses.

I found mention of www.example.com and ipv6.example.com in Beej's Guide, but ipv6.example.com doesn't seem to exist any more... The best I've found so far is c.iana-servers.net which has both an IPv4 and IPv6 addresses it resolves to, but I don't know how stable that is...

A: 

Well no, nothing will resolve if your computer is not online.

Thus you'll just need to run your own local dns server (i.e. put entries in your systems hosts file).

Noon Silk
Well - I was assuming actually being able to resolve the address as a prereq for running the tests...
Graham
The address still resolves if it's set up locally, otherwise you can't be sure if the error is down the line of you.
Noon Silk
+1  A: 

That is quite a good question. I can not give you a single domain that you can rely on, however there ar ea few more issues you might want to be aware of. Content Delivery Networks tend to reroute the traffic to the server via DNS lookups baised on geography. If you are looking to get this project to be consistant amongst other locations look for a server that isn't under a CDN or a caching server.

My suggest is to create your own server, that way you can control all of the variables.

monksy