小编Zac*_*iel的帖子

dnsmasq 读取 /etc/hosts,但不使用它

我已经完成了 dnsmasq 的默认安装。当我运行 dig 时,它似乎在使用 dnsmasq (127.0.0.1),但结果不包括 /etc/hosts 中包含的主机名。

/etc/hosts:

192.168.1.13 sun
Run Code Online (Sandbox Code Playgroud)

在终端中:

$ dig sun

; <<>> DiG 9.6-ESV-R4 <<>> sun
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 32131
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;sun.               IN  A

;; AUTHORITY SECTION:
.           9699    IN  SOA a.root-servers.net. nstld.verisign-grs.com. 2011041100 1800 900 604800 86400

;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: …
Run Code Online (Sandbox Code Playgroud)

linux hosts-file dnsmasq

8
推荐指数
3
解决办法
2万
查看次数

标签 统计

dnsmasq ×1

hosts-file ×1

linux ×1