OPNsense Forum

Archive => 18.7 Legacy Series => Topic started by: cclloyd on September 06, 2018, 12:51:28 pm

Title: Unbound DNS Help?
Post by: cclloyd on September 06, 2018, 12:51:28 pm
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?
Title: Re: Unbound DNS Help?
Post by: marjohn56 on September 06, 2018, 02:59:50 pm
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.
Title: Re: Unbound DNS Help?
Post by: cclloyd on September 07, 2018, 12:52:24 am
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`.