Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm running Scientific Linux 6.3 and just updated the machine to dnsmasq-2.48-13.el6.x86_64. The machine is on local ip 192.168.1.100. I have a local caching DNS setup that was working until the update.

/etc/dnsmasq.conf configuration:

strict-order
listen-address=192.168.1.100
bind-interfaces
cache-size=5000

I confirmed that dnsmasq is running, the ports open and close as I start and stop dnsmasq.

$ netstat -nl # shows that the port was opened
Proto Recv-Q Send-Q Local Address           Foreign Address        State
tcp        0      0 192.168.1.100:53        0.0.0.0:*              LISTEN
udp        0      0 192.168.1.100:53        0.0.0.0:*

but trying to resolve fails

$ nslookup google.com 192.168.1.100
;; connection timed out; trying next origin
;; connection timed out; no servers could be reached

even trying to telnet fails

$ telnet 192.168.1.100 53
Trying 192.168.1.100...
telnet: connect to address 192.168.1.100: Connection refused

I don't seen anything in /var/log/messages related to dnsmasq. Stopping iptables didn't help. I'm not sure where to go from here.

share|improve this question
    
I just realized, I can connect to dnsmasq on the machine remotely. But the local machine can't connect to itself using either 127.0.0.1 or 192.168.1.100. Both refuse connections. –  dan Apr 2 '13 at 18:16
    
Should we take this to mean that you're only getting a "refused" when connecting to 192.168.1.100 from the same machine but connecting to 192.168.1.100 from a different machine does work? –  Joel Davis Apr 2 '13 at 18:54
    
That is correct. Connecting to port 53 on 192.168.1.100 from a different machine on the network works fine. –  dan Apr 2 '13 at 18:54
    
Have you checked the firewall to see if that's blocking it? –  Joel Davis Apr 2 '13 at 19:01
    
I turned iptables off. That was the only firewall running. That didn't help. –  dan Apr 2 '13 at 19:07

1 Answer 1

up vote 0 down vote accepted

Based on your additional info, you need to add this line to dnsmasq.conf, which my Slackware machine has in /etc/:

listen-address=127.0.0.1

That's in addition to the other listen-address line. You can configure more than one "listen-address". My guess is that you also need to comment out the "bind-interfaces" line, too, but that's just a guess.

You should also check what the resolv-file parameter value is. Does that file exist, and do its contents make sense? You probably don't want something like:

resolv-file=/etc/resolv.conf

because that would make all the calls to gethostbyname() either skip using dnsmasq, or dnsmasq will try to use itself to resolve names, depending on what's in /etc/resolv.conf.

Don't forget to restart dnsmasq after making changes.

share|improve this answer
    
That worked. bind-interfaces DID need to be commented out also... Thanks. –  dan Apr 2 '13 at 19:09

Your Answer

 
discard

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

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