9

I'm running dnsmasq,

address=/chat.freenode.net/130.239.18.172
address=/chat.freenode.net/140.211.167.105

But seems dnsmasq only recognize the last record, what should I do?

13

Create a file, say /etc/hosts.chat.freenode.net, that has the same format as /etc/hosts file and list all IP addresses with name in this file:

130.239.18.172 chat.freenode.net
140.211.167.105 chat.freenode.net

Then add to the dnsmasq.conf the following line:

addn-hosts=/etc/hosts.chat.freenode.net

Or put these two lines into /etc/hosts if dnsmasq is set to read in the /etc/hosts.

Then restart dnsmasq

Enjoy.

  • Yep, easier to maintain – daisy Nov 24 '12 at 6:43
  • I guess the only problem with using /etc/hosts would be that the local machine would always resolve the first one instead of getting a round-robin distribution from dnsmasq. – Jeff Puckett Apr 5 '17 at 22:04
  • 1
    @JeffPuckettII although resolver library would return the first found entry always, the answer is related to the setting dnsmasq to read /etc/hosts – Serge Apr 7 '17 at 10:07
-4

Copy the existing ifcfg-etho to ifcfg-eth0:0 and change the existing IP to your virtual IP (the one you want to add).

It can be found at /etc/sysconfig/network-scripts.

Restart the network and try to ping the virtual IP.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.