开发者

Sample domains for testing DNS lookups

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 开发者_StackOverflow中文版is...


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.


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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜