dnsmasq: DNS request timed out for machines in local network

0

I have a vagrant machine running on my mac with virtual hosts I want to make available to my local network. I installed dnsmasq via brew and have the following in its /usr/local/etc/dnsmasq.conf:

address=/lv.lc/33.33.33.10

so that all URLs ending with *.lv.lc will resolve to 33.33.33.10.

It works partially: dig www.lv.lc

gives me the correct answer:

anton@anton-mbp:~$ dig www.lv.lc
; <<>> DiG 9.10.1 <<>> www.lv.lc
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 54075
;; flags: qr aa rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.lv.lc.         IN  A

;; ANSWER SECTION:
www.lv.lc.      0   IN  A   33.33.33.10

but when I try to ping that host,

anton@anton-mbp:~$ ping www.lv.lc
ping: cannot resolve www.lv.lc: Unknown host

I added local IP of machine running dnsmasq to dns servers of my router, but other clients in this network don't get response from it even when I explicitly perform a nslookup:

DNS request timed out.
    timeout was 2 seconds.
Address: 192.168.1.38

What do I do wrong?

g_ain

Posted 2014-12-30T10:52:16.473

Reputation: 1

Are you using public virtual network adapter in the vm? Probabily you are using private network adapter. https://docs.vagrantup.com/v2/networking/public_network.html

– maudam – 2014-12-30T11:29:15.203

Answers

0

I'm dumb. dnsmasq was not set up to listen on 192.168.1.38 so I added

listen-address=192.168.1.38
listen-address=127.0.0.1

to my dnsmasq.conf file so it works now.

g_ain

Posted 2014-12-30T10:52:16.473

Reputation: 1