OPNsense Forum

Archive => 18.1 Legacy Series => Topic started by: binaryanomaly on April 20, 2018, 11:30:08 am

Title: [SOLVED] .localdomain not being picked up by unbound DNS
Post by: binaryanomaly on April 20, 2018, 11:30:08 am

I have a pretty simple standard setup of opnsense. I use the DHCPv4 service of opnsense.

System -> Settings -> General -> Domain: localdomain
Services -> DHCPv4 -> [LAN] -> Domain name: (is empty)
The default is to use the domain name of this system as the default domain name provided by DHCP. You may specify an alternate domain name here.

Service -> Unbound DNS -> General ->  DHCP Registration: ticked

If this option is set, then machines that specify their hostname when requesting a DHCP lease will be registered in the DNS Resolver, so that their name can be resolved.

Now I would expect that I can refer to systems by their local domain name, i.e. system.localdomain from a client that is registered by the DHCP service and provided with the ip of opnsense for dns resolution. Instead I get:
Code: [Select]
ping: cannot resolve system.localdomain: Unknown hostAccessing by IP works just the DNS resolution not.

DNS lookup via Interfaces -> Diagnostics -> DNS Lookup: Does not work either

Why is this not working, have I done something wrong?
The unbound service is running, resolution of internet domain names works and I do not see anything suspicious in the provided logs.

Title: Re: .localdomain not being picked up by unbound DNS
Post by: Alphakilo on April 20, 2018, 12:25:36 pm
does "system" resolve without the .localdomain suffix?
Title: Re: .localdomain not being picked up by unbound DNS
Post by: binaryanomaly on April 20, 2018, 01:19:44 pm
does "system" resolve without the .localdomain suffix?

Code: [Select]
ping: cannot resolve system: Unknown host
nslookup gives this:

Code: [Select]
nslookup system.localdomain

** server can't find system.localdomain: NXDOMAIN
Title: Re: .localdomain not being picked up by unbound DNS
Post by: binaryanomaly on April 21, 2018, 11:48:12 am
Ok, I was able to solve it myself:

There's a configuration option that needs to be enabled:
Services -> Unbound DNS -> General -> DHCP Static Mappings:  Register DHCP static mappings in the DNS Resolver (ticked)

I didn't notice this because naturally you start without static mappings and when adding them later my systems disappeared from DNS. I'm not quite sure if the logic makes sense to enable this by default for dynamically mapped clients/hosts but not for statically mapped ones - it seems inconsistent to me.

However - problem solved!  8)
Title: Re: [SOLVED] .localdomain not being picked up by unbound DNS
Post by: overture on July 18, 2018, 10:20:53 am
Hi I am trying to get this working. I've followed what you did and get this issue when I try to change the host from WORKGROUP to a domain in Windows 10pro settings.

The following error occurred when DNS was queried for the service location (SRV) resource record used to locate an Active Directory Domain Controller (AD DC) for domain "localdomain":

The error was: "DNS name does not exist."
(error code 0x0000232B RCODE_NAME_ERROR)

The query was for the SRV record for _ldap._tcp.dc._msdcs.localdomain

Common causes of this error include the following:

- The DNS SRV records required to locate an AD DC for the domain are not registered in DNS. These records are registered with a DNS server automatically when an AD DC is added to a domain. They are updated by the AD DC at set intervals. This computer is configured to use DNS servers with the following IP addresses:

- One or more of the following zones do not include delegation to its child zone:

. (the root zone)

any ideas would be much appreciated

A bit more info:
I have multiple VLANS sitting on a lagg defined as LAN interface that has its own static ip (and I'm not sure if I can remove that ip and have ip4 config set to none. I'd prefer to do that, so that all ip interfaces are solely defined in VLANS. Except last time I tried opnsense crashed badly. I had to re-install)
Each VLAN has a static ip and DHCP server (but I mostly set a host to fixed ip), Im using unbound for DNS and all default assignments, there's only one gateway on the ppoe wan side

All pcs in all VLANS have this issue of not being able to change from workgroup to a domain. Sorry if these are newb questions.