OPNsense Forum

Archive => 20.7 Legacy Series => Topic started by: user1234 on August 11, 2020, 08:03:31 PM

Title: unqualified DNS query unbound
Post by: user1234 on August 11, 2020, 08:03:31 PM
Is it possible to set a default domain on unbound so if a DNS request comes in for a hostname (not fqdn) it appends a default domain to it.
e.g. DNS request for 'printer.' gets mapped to 'printer.home'

Currently I can't get these requests to resolve to anything even with static mappings.
Title: Re: unqualified DNS query unbound
Post by: tong2x on August 12, 2020, 07:39:12 AM
have you already added in the overrides section in ubound?
and it still does not resolve?
Title: Re: unqualified DNS query unbound
Post by: user1234 on August 12, 2020, 08:44:43 PM
yes I have added it to the host overrides but it isn't picked up unless I specify the fqdn.
Title: Re: unqualified DNS query unbound
Post by: Vilhonator on August 12, 2020, 09:15:29 PM
is this something you are looking for?
Title: Re: unqualified DNS query unbound
Post by: Mks on August 12, 2020, 09:58:27 PM
Hi,

have you set the domain in
    System: Settings: General
?

The default is to use the system domain as the default domain name provided by DHCP. You may specify an alternate domain name in the DHCP settings

br

Title: Re: unqualified DNS query unbound
Post by: user1234 on August 13, 2020, 09:37:45 AM
I have a domain for the system set to "home" in System: Settings: General.
I then have an override on the unbound DNS for "server1" with domain set to "home".

If I try and resolve the name "server1" from a machine without DNS search domain set i.e. a DNS lookup for "server1." it fails. If I do a request for "server1.home" it works.

What I need is the ability for the "server1." request to resolve to "server1.home" as I have a lot of embedded devices which do not support DNS search domains.

Should this work by default with opnsense?
Title: Re: unqualified DNS query unbound
Post by: Maurice on August 14, 2020, 01:17:40 AM
Quote from: user1234 on August 13, 2020, 09:37:45 AM
What I need is the ability for the "server1." request to resolve to "server1.home" as I have a lot of embedded devices which do not support DNS search domains.

Just use FQDNs. Relying on the client's OS to append a search domain or on the DNS resolver to handle unqualified queries is always a gamble.

Cheers

Maurice
Title: Re: unqualified DNS query unbound
Post by: Mks on August 15, 2020, 08:01:56 AM
QuoteJust use FQDNs.
Definitly the best idea  ;D
Title: Re: unqualified DNS query unbound
Post by: phoenix on August 15, 2020, 10:08:25 AM
IIRC, the dig command is slightly broken when searching for a hostname. You can use nslookup for a hostname or you can use "dig +search hostname" to get the IP of a host.