Unbound DNS Help?

Started by cclloyd, September 06, 2018, 12:51:28 PM

Previous topic - Next topic
First of all, does anyone know of a good unbound DNS tutorial that will work well with OPNSense?

My goal: to get vpn.example.com to resolve to lan address when querying from home network, and to public IP when querying externally.

I use Unbound DNS as it was the default.

I'm sort of new to OPNSense and don't understand how exactly to set it up.

The host has a hostname `vpn.example.com` and an IP 10.0.0.11.

How can I be able to access it by 10.0.0.1 when querying vpn.example.com on my home network, and have it show `xx.xx.xxx.xxx` when querying from another network, yet still resolve to the proper host?

Just use a host override in Unbound. Just go to Services->Unbound DNS->Overrides.


Enter the Hostname, Domain and IP address. Save it.


Remember to flush the dns cache on your PC, windows it's ipconfig /flushdns




For external you'll need to add it as an A or AAAA record at your domain host.
OPNsense 25.7a - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member

September 07, 2018, 12:52:24 AM #2 Last Edit: September 07, 2018, 04:50:43 AM by cclloyd
I do have that.  Under host overrides I have:

Host: vpn (hostname on VM is just vpn)
Domain: vpn.example.com
Type: A
Value: 10.0.0.11

I can ping it from inside my network only, and it shows my external IP, but I can't connect to it at all externally, and can't ssh internally using the hostname.


EDIT:  Fixed it. 

The issue was the domain should just be `example.com` instead of `vpn.example.com`.