[Dnsmasq-discuss] Ping does not work but nslookup works (Use dnsmasq on Mac OS X)

Simon Kelley simon at thekelleys.org.uk
Mon Dec 23 15:14:59 GMT 2013


On 23/12/13 15:03, Peng Yu wrote:
> Hi,
>
> I followed the instruction at the following address (after section
> "Solution: DNSMasq"). My machine is Mac OS X 10.8.5.
>
> http://www.justincarmony.com/blog/2011/07/27/mac-os-x-lion-etc-hosts-bugs-and-dns-resolution/
>
> The only difference is that I have the following configuration on my mac machine
>
> /etc$ cat /etc/resolv.dnsmasq.conf
> nameserver 192.168.1.25
> nameserver 8.8.8.8
> nameserver 8.8.4.4
> /etc$ sudo networksetup -getdnsservers Wi-Fi
> 127.0.0.1
>
> 192.168.1.25 is another DNS in my home network, which has the
> information for oxygen.yulab. But the following commands shows that
> ping is not able to find the correct ip. Does anybody know what is
> wrong and how to debug such a problem?
>
> Thanks.
>
> ~$ nslookup oxygen.yulab
> Server:        127.0.0.1
> Address:    127.0.0.1#53
>
> Non-authoritative answer:
> Name:    oxygen.yulab
> Address: 192.168.1.163
>
> ~$ ping oxygen.yulab
> ping: cannot resolve oxygen.yulab: Unknown host
>

You need to tell dnsmasq that it has to ask only the 192.168.1.25 server 
for information about oxygen.yulab.

The way to do this is to remove
nameserver 192.168.1.25 from resolv.dnsmasq.conf and add to the main 
dnsmasq configuration file

server=/oxygen.yulab/192.168.1.25

or start dnsmasq with a command line option

dnsmasq --server=/oxygen.yulab/192.168.1.25


Once that's done, queries for *.oxygen.yulab will go to 192.168.1.25 and 
everything else will go to Google.

Cheers,

Simon.



More information about the Dnsmasq-discuss mailing list