我是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
另请参阅此超级用户问题
—
Jimothy 2013年