AdguardTeam / dnsproxy

Simple DNS proxy with DoH, DoT, DoQ and DNSCrypt support
Apache License 2.0
2.37k stars 246 forks source link

dnsproxy doesn't work on localhost ipv6 #225

Closed cfouche3005 closed 2 years ago

cfouche3005 commented 2 years ago

Dnsproxy work with 127.0.0.1 but it doesn't work on ::1

my conf with the ip and domain replaced with * listen-addrs:

ameshkov commented 2 years ago

Unfortunately, this is not something we can change, dnsproxy uses the standard golang approach and listeners. If something does not work as expected, it probably should be fixed in golang itself.

Also, why would you need to listen to ::1 specifically? And if you do need, you may try to listen to 0.0.0.0, i.e. listen to all interfaces.

cfouche3005 commented 2 years ago

I am on fedora and 127.0.0.53:53 is already use for system-resolve and I don't know if I deactivate it it will break the gnome network manager ?

Lanius-collaris commented 2 years ago

I am on fedora and 127.0.0.53:53 is already use for system-resolve and I don't know if I deactivate it it will break the gnome network manager ?

You can configure DNS ( 127.0.0.1 and ::1 ) using GNOME control-center application, then run dnsproxy.

cfouche3005 commented 2 years ago

After more research, dnsproxy just doesn't work for ipv6 : if I make my pc use ipv6 only with dns proxy as my dns, it doesn't work but if I use my FAI dns it work on ipv6 only.

IPV6 only with dnsproxy Capture d’écran du 2022-04-10 22-37-36 Capture d’écran du 2022-04-10 22-37-50 Capture d’écran du 2022-04-10 22-38-16 IPV6 only with FAI dns Capture d’écran du 2022-04-10 22-38-55 Capture d’écran du 2022-04-10 22-39-09 Capture d’écran du 2022-04-10 22-39-54

cfouche3005 commented 2 years ago

After some more research ::1 doesn't work but 2a01:cb18:ad3:900:2519:ce41:bf8c:b4a9 works so don't know what to think of that

cfouche3005 commented 2 years ago

can I reopen the issue.

ameshkov commented 2 years ago

::1 is a special IP address and the way connections to it are handled depend on the OS a lot. The issue may be with the DNS client since I am pretty sure dnsproxy works just okay with IPv6 in general.

Your real issue is with systemd-resolved and not dnsproxy. Maybe it'd be better to simply disable the stub resolver? https://unix.stackexchange.com/questions/304050/how-to-avoid-conflicts-between-dnsmasq-and-systemd-resolved

Lanius-collaris commented 2 years ago

Maybe this DoH server didn't support IPv6? Please use dnsproxy -v ... to get more detail.

cfouche3005 commented 2 years ago

@ameshkov I have deactivated the stub resolver of systemd-resolved

cfouche3005 commented 2 years ago

@Lanius-collaris the doh server work ipv6 ( I have it on my phone and it work )

ameshkov commented 2 years ago

@cfouche3005 if you deactivated it, you can configure dnsproxy to listen to 0.0.0.0, it'll cover all interfaces.