Resolving DNS & localhost (IPv4/IPv6)

Started by Evert, April 08, 2024, 10:32:39 AM

Previous topic - Next topic
April 08, 2024, 10:32:39 AM Last Edit: April 08, 2024, 11:46:10 AM by Evert
Hi,

We're running OPNsense with Unbound DNS. I was noticing that some quries made by localhost resulted in SERVFAIL.

With some testing in the cli I noticed the following: When running 'drill @localhost google.com' it either responds immediately, or it takes 15 seconds.
Given that 'drill @127.0.0.1 google.com' & ' drill -4 @localhost google.com' always respond immediately I think I have narrowed it down to the fact that /etc/hosts contains:
127.0.0.1       localhost       localhost.domain.com
::1             localhost       localhost.domain.com

However, it doesn't appear Unbound listens on IPv6 on my system.

Looks like I should either remove that ::1-line from /etc/hosts, or get Unbound to listen on IPv6 as well.

Any recommendations?
--
Regards,
   Evert