运行dnsmasq的OSX并不总是处理默认的dns查询


1

我是OSX的开发人员,我一直在使用.local进行开发的本地站点。由于ML,我一直在运行DNSmasq来解决服务查询顺序,因此我可以继续使用/ etc / hosts定义我的记录(我相信DNSmasq会采用)。

我以为它在起作用,但似乎不一致,它对某些人有用,而对其他人却无效。

对无法使用的域执行Ping操作似乎会延迟30秒左右。在网络浏览器中访问同一域永远无法解决。挖掘域,立即从DNSmasq返回A记录结果

robaldred:~/Sites/sasp (master)
 → ping sasp.local

# insert long pause here

PING localhost (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.089 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.136 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.141 ms

robaldred:~/Sites/sasp (master)
 → dig sasp.local

; <<>> DiG 9.8.3-P1 <<>> sasp.local
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55538
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;sasp.local.            IN  A

;; ANSWER SECTION:
sasp.local.     0   IN  A   127.0.0.1

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Apr  8 15:05:25 2013
;; MSG SIZE  rcvd: 44

/etc/resolv.conf

#
# Mac OS X Notice
#
# This file is not used by the host name and address resolution
# or the DNS query routing mechanisms used by most processes on
# this Mac OS X system.
#
# This file is automatically generated.
#
nameserver 127.0.0.1

/etc/resolv.dnsmasq.conf

nameserver 2001:4860:4860::8888
nameserver 2001:4860:4860::8844
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 2620:0:ccc::2
nameserver 208.67.222.222 

/usr/local/etc/dnsmasq.conf

http://pastie.org/7370748


Answers:


1

首先,您应该选择以外的后缀.local。该伪TLD对于mDNS / Bonjour具有特殊含义。我使用.dev,但是您可以使用任何不是有效TLD或伪TLD的东西。

然后,您可能会发现对另一个超级用户问题的回答很有用。dig不会起作用,但是pingcurl等等会起作用,就像在网络浏览器中打开您的网站一样。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.