I'm trying to enable both IPv4 and IPv6 stack on SUSE 15 environment. I've assigned both IPv4 and IPv6 addresses to the same interface using /opt/vmware/share/vami/vami_set_network. Both IPv4 and IPv6 addresses are pingable.
Now I need to enable dns resolution for both IPv4 and IPv6 using dnsmasq. But when I use dig to check the dns server status, dig IPv4 address succeed while dig IPv6 address failed with refused.
Is there anything to notice to configure an IPv6 dns server with dnsmasq?
# dig 2001:db8:3333:4444:5555:6666:7777:200
; <<>> DiG 9.16.6 <<>> 2001:db8:3333:4444:5555:6666:7777:200
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 64764 <<<<<<<<<<<<<<<<<<<<<<
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;2001:db8:3333:4444:5555:6666:7777:200. IN A
;; Query time: 0 msec
;; SERVER: ::1#53(::1)
;; WHEN: Mon Sep 27 16:42:04 UTC 2021
;; MSG SIZE rcvd: 55
# dig 172.20.10.25
; <<>> DiG 9.16.6 <<>> 172.20.10.25
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 60743
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;172.20.10.25. IN A
;; ANSWER SECTION:
172.20.10.25. 0 IN A 172.20.10.25
;; Query time: 0 msec
;; SERVER: ::1#53(::1)
;; WHEN: Mon Sep 27 16:45:54 UTC 2021
;; MSG SIZE rcvd: 57
Another issue is that, when I add both ipv4 and ipv6 record in /etc/hosts, only the ipv4 record can be resolved properly.
# cat /etc/hosts
192.168.10.10 ipv4-hostname.com
2001:db8:3333:4444:5555:6666:7777:200 ipv6-hostname.com
# dig @127.0.0.1 ipv4-hostname.com +short +time=15 +tries=3
192.168.10.10
# dig @127.0.0.1 ipv6-hostname.com +short +time=15 +tries=3
<<<<< empty result
dnsmasq server configuration is default:
# cat /etc/dnsmasq.conf | grep -v '^#' | grep -v '^$'
conf-dir=/etc/dnsmasq.d/,*.conf
Here's the hostname dig result, refused as well:
# dig ipv6-hostname.com
; <<>> DiG 9.16.6 <<>> ipv6-hostname.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 4887
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;ipv6-hostname.com. IN A
;; Query time: 0 msec
;; SERVER: ::1#53(::1)
;; WHEN: Tue Sep 28 08:24:45 UTC 2021
;; MSG SIZE rcvd: 30
Port status:
# netstat -lnp | grep dnsmasq
tcp 0 0 0.0.0.0:53 0.0.0.0:* LISTEN 19455/dnsmasq
tcp6 0 0 :::53 :::* LISTEN 19455/dnsmasq
udp 0 0 0.0.0.0:53 0.0.0.0:* 19455/dnsmasq
udp6 0 0 :::53 :::* 19455/dnsmasq
Seems both ipv4 and ipv6 wildcard are listening in the environment. Not sure why ipv6 dig kept being refused.