I've just set up dnsmasq in my home lan for the first time. I got it as DHCP and DNS.

Something strange is that when I ping DEV01 (which has dnsmasq) it resolves to and I don't know why it is doing so.

jorgee@jorgee:~$ nslookup dev01

Name:   dev01

Is anything else to configure?

  • Is dev01 on the same physical machine as dnsmasq, and what is the contents of /etc/hosts ? – davidgo Feb 1 '13 at 5:58
  • @Hi, yes its the same machine, its the host of dnsmasq. – JorgeeFG Feb 1 '13 at 12:15
  • Does your /etc/hosts file have a line like " dev01" in it ? The reason why dev01 is coming up as is because it is !!! (also known as localhost) is an address assigned to every machine so that it can refer to itself !!! Different distros would handle it differently I imagine, so I would not be surprised if your distro has added dev01 to the hosts file with a definition of localhost, which is then translated into the dns by dnsmasq. A solution might be to update /etc/hosts or force an override for that machine only in dnsmasq.conf. – davidgo Feb 1 '13 at 18:37
  • @davidgo Thanks that solved it, I've added changed " dev01" to " dev01". Is it possible to use that only for local requests but not for other pc's requests? – JorgeeFG Feb 2 '13 at 23:51
  • Not sure I understand what you are asking. It You should only need to change to the address of your server on your server and DNSMasq will add it into the DNS for other machines to use. In an ideal world you should refer to dev01 by its real IP address, as is named "localhost" - specifying the machine name as localhost is, I believe, a bit of a hack for when you don't know the name of the resource. – davidgo Feb 3 '13 at 0:53

The solution is to change the hosts file to reflect the IP Address of the network interface (ie change to

This works because DNSMasq is translating the Domain name into the IP address based on the contents of the "hosts" file, and the hosts file is set to point the domain name to which is a special address each machine on the Internet has so it can refer to itself even without a valid Internet connection - but does not work so well for a server.

| improve this answer | |

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.