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

Peng Yu pengyu.ut at gmail.com
Mon Dec 23 15:35:23 GMT 2013


On Mon, Dec 23, 2013 at 9:14 AM, Simon Kelley <simon at thekelleys.org.uk> wrote:
> 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

Here are the current file contents. I have several local servers in
the domain yulab. So I should use "server=/yulab/192.168.1.25"
instead?

/etc$ grep yulab /opt/local/etc/dnsmasq.conf
server=/yulab/192.168.1.25
/etc$ cat /etc/resolv.dnsmasq.conf
nameserver 8.8.8.8
nameserver 8.8.4.4

Still, the oxygen server is not available. But others are available.
Do you see how to debug this issue? Thanks.

/etc$ ping oxygen.yulab
ping: cannot resolve oxygen.yulab: Unknown host
/etc$ ping boron.yulab
PING boron.yulab (192.168.1.123): 56 data bytes
64 bytes from 192.168.1.123: icmp_seq=0 ttl=64 time=29.629 ms
/etc$ 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

/etc$ nslookup boron.yulab
Server:        127.0.0.1
Address:    127.0.0.1#53

Name:    boron.yulab
Address: 192.168.1.123

> 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.
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss



-- 
Regards,
Peng



More information about the Dnsmasq-discuss mailing list