0

I installed dnsmasq to provide both DHCP and DNS on my home network. Everything was working swimmingly until just now.

Seemingly out of the blue I was unable to connect to the internet on any computer on my network. Nor could I connect to the computer running dnsmasq by hostname.

I couldn't for the life of me figure out what was wrong. I tried restarting the computer. I tried restarting dnsmasq. I checked the dnsmasq syslog entries and I noticed that, after restarting dnsmasq, dnsmasq was complaining about /var/run/dnsmasq/resolv.conf being empty. That seemed weird.

I checked /etc/network/interfaces, several times, and finally I noticed that the stanza for the relevant interface in my file was slightly different than an example I saw online.

Here's what I had:

auto eth0
iface eth0 inet static
        address 192.168.1.2
        netmask 255.255.255.0
        gateway 192.168.1.1
        nameserver 192.168.1.1

I changed the last line to this:

dns-nameservers 192.168.1.1

and almost immediately after I restarted the interface, DNS requests were working again.

How was dnsmasq working before I changed the interfaces files?

  • 1
    "How was dnsmasq working before I changed the interfaces files?" how exactly was he working? Could it resolve hostnames? – Braiam Feb 4 '15 at 2:26
  • 1
    Kind of hard to tell now but there may have been an older resolv.conf setting that was overwritten in response to some random event that happened recently. That would've broke DNS which you then fixed by enabling the system to re-populate that file with the correct information. – Bratchley Feb 4 '15 at 2:26
  • @Braiam dnsmasq was resolving hostnames, both private and public. – Kenny Evitt Feb 4 '15 at 2:30
  • 1
    How do you know it was dnsmasq doing the resolving in the past? If /etc/resolv.conf had a nameserver 192.168.1.1 line, resolving would have worked fine, bypassing dnsmasq altogether. – wurtel Feb 4 '15 at 8:40
  • @wurtel I'm pretty sure it was dnsmasq because it was resolving hosts in the private domain on my network. 192.168.1.1 is a router, tho before I setup dnsmasq it was providing DHCP and DNS, tho it was ultimately unreliable at resolving hosts in the private domain. I was also logging DNS queries received by dnsmasq and observed requests – particularly all of the ones for which I was having problems – in syslog. – Kenny Evitt Feb 4 '15 at 14:24

Your Answer

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

Browse other questions tagged or ask your own question.