Monday, 28 August 2017

dns - Ping to dnsmasq's host resolvesto 127.0.0.1


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 127.0.0.1 and I don't know why it is doing so.


jorgee@jorgee:~$ nslookup dev01 192.168.1.2
Server: 192.168.1.2
Address: 192.168.1.2#53

Name: dev01
Address: 127.0.1.1

Is anything else to configure?



Answer



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


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 127.0.0.1 which is a special address each machine on the Internet has so it can refer to itself even without a valid Internet connection - but 127.0.0.1 does not work so well for a server.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...