![dnsmasq 中的 IPv6 地址](https://linux22.com/image/1300935/dnsmasq%20%E4%B8%AD%E7%9A%84%20IPv6%20%E5%9C%B0%E5%9D%80.png)
由于我需要使用 dnsmasq 将 *.local 上的所有请求路由到我的本地机器(并在那里使用 IPv6 地址),所以我像这样设置 dnsmasq:
/etc/dnsmasq.d/my-local.conf
address=/local/::1
listen-address=::1
/etc/resolv.conf
nameserver ::1
nameserver 127.0.0.1
# Generated by NetworkManager
nameserver 192.168.43.1
但挖掘任何东西。本地没有答案。我哪里设置错了?
radek@me:/$ dig anything.local
; <<>> DiG 9.8.1 <<>> anything.local
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 30189
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;anything.local. IN A
;; Query time: 0 msec
;; SERVER: ::1#53(::1)
;; WHEN: Sun Jan 8 09:39:10 2012
;; MSG SIZE rcvd: 32
如果像这样更改 my-local.conf:
address=/local/127.0.0.1
listen-address=127.0.0.1
我明白了:
radek@me:/$ dig anything.local
; <<>> DiG 9.8.1 <<>> anything.local
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13675
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;anything.local. IN A
;; ANSWER SECTION:
anything.local. 0 IN A 127.0.0.1
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sun Jan 8 09:40:47 2012
;; MSG SIZE rcvd: 48
这意味着 IPv6 地址可能会引起麻烦。
答案1
我相信只要你正确询问就会起作用,那就是:dig aaaa anything.local