It is not possible to bind only IPv4 or only IPv6
Author: ProchyCreated Apr 29, 2025Updated Aug 6, 2026
Labelsbug
What happened: When trying to bind IPv4 interfaces only
. {
bind 0.0.0.0
}The coredns start listening also on ipv6 interfaces.
What you expected to happen: When 0.0.0.0 is used, it should listen on IPv4 only. The same with :: (IPv6 only). If possible it should be also possible to have corefile like this:
. {
bind 0.0.0.0
}
. {
bind ::
}And the coredns starts...Currently it is not possible as:
maxprocs: Leaving GOMAXPROCS=8: CPU quota undefined
Listen: listen tcp 0.0.0.0:53: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted.How to reproduce it (as minimally and precisely as possible): Both of this:
. {
bind 0.0.0.0
}Or:
. {
bind ::
}Listens on IPv6 and IPv4:
netstat -ano | findstr :53
TCP 0.0.0.0:53 0.0.0.0:0 LISTENING 14536
TCP [::]:53 [::]:0 LISTENING 14536
UDP 0.0.0.0:53 *:* 14536
UDP [::]:53 *:* 14536Environment:
- the version of CoreDNS: CoreDNS-1.12.0
- OS: Windows 11 22H2
Feel free to rejected if it is not planned to fix it or if it's intended behavior.
Source: coredns/coredns