OPNsense Forum

English Forums => General Discussion => Topic started by: kermitxyz on December 07, 2024, 10:12:04 PM

Title: Local DNS
Post by: kermitxyz on December 07, 2024, 10:12:04 PM

I wish to have the OPNSense router enable DNS resolution for local hosts.  I can see two ways:

1. Use UnboundDNS and enable "Register DHCP Static Mappings"

2. Disable UnboundDNS and use DNSMasq instead.  I think the latter is better as I can then add other static hostnames other than those assigned by DHCP.

Is this the best way?

I am enjoying learning OPNSense so thank you for the help ;)
Title: Re: Local DNS
Post by: Patrick M. Hausen on December 07, 2024, 10:16:54 PM
You can easily add static DNS entries to Unbound, too. See "Overrides".
Title: Re: Local DNS
Post by: kermitxyz on December 07, 2024, 10:26:24 PM
Thanks, I'll check that.  Which is the better way though?
Title: Re: Local DNS
Post by: Patrick M. Hausen on December 07, 2024, 10:30:16 PM
Unbound is the standard in OPNsense and works for me. I never looked into anything else.

(besides BIND where I need secondary domains)
Title: Re: Local DNS
Post by: kermitxyz on December 08, 2024, 12:16:36 AM
So if I want "dev" to resolve to 192.168.123.123

I use * as the host and "dev" as the domain?

It works, but is that right?  I am not convinced I've done that properly.
Title: Re: Local DNS
Post by: Patrick M. Hausen on December 08, 2024, 12:30:18 AM
You have your local domain, right? Something like "myhome.lan".

So you create an override of "dev.myhome.lan" with the correct IP address. See screen shot for reference.

HTH,
Patrick
Title: Re: Local DNS
Post by: kermitxyz on December 08, 2024, 11:23:18 PM
Hi Patrick

That works fine - thank you. 

For future reference if anyone else reads this post, I did have to restart the router after making the changes (restarting the service alone for some reason was not enough)

Cheers
Richard