Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want that a name should be resolved with multiple IPv6 addresses. I don't have access to a DNS server and I don't want to run a demon for that purpose.

I want to add the entry in /etc/hosts and it should return two IPv6 addresses for a single name.

share|improve this question

migrated from Aug 5 '12 at 13:29

This question came from our site for professional and enthusiast programmers.

Well, if you want to do that, just do so :-)

If you add this to /etc/hosts:

2001:db8::1 testing
2001:db8::2 testing testing

then the hostname will have three addresses:

$ telnet testing
Trying 2001:db8::1...
Trying 2001:db8::2...
telnet: Unable to connect to remote host: No route to host

In this case the addresses don't exist so the connection fails, but you can see that it works.

share|improve this answer
I did the same. I gave link local address. I tried to ping them. Only the first address gets pinging. Acutally I want to check whether my machine is doing address select. So it is necessary to receive multiple A values for a particular name. – theB Aug 2 '12 at 13:54
Ping does get multiple addresses. It just chooses to always use the first one. If you want a different order then you will have to reorder /etc/hosts, or use something that does automatic shuffling like DNS – Sander Steffann Aug 2 '12 at 14:58
No. I want to ping to perform Default address selection (RFC3484) among all the addreses it receives before sending ICMP_REQUEST to the host. – theB Aug 3 '12 at 5:01
Then talk to the developers of ping – Sander Steffann Aug 3 '12 at 9:16
I am talking about ping6. Its already doing things correct. I don't know whether it is done by ping6 or the linux filters correct address from the list. But things works fine other than link local case. If destination has link local and global and source having link local and site local, my kernel prefers link locla dest with site local src. But accroding to RFC3484 it is wrong. – theB Aug 3 '12 at 9:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.