Define hostnames to IP Address [Solved]

Started by pankaj, November 18, 2021, 03:18:40 AM

Previous topic - Next topic
November 18, 2021, 03:18:40 AM Last Edit: November 21, 2021, 08:08:25 AM by pankaj
Hi,

If I've a Synology NAS on home network called "NAS", is there any configuration within OPNSense that allows http://NAS to resolve to the specified IP address?

The home LAN is configured to use OPNSense for DNS service.
Thanks,

You can use dnsmasq instead of unbound dns then add the ip and hostanme as shortname to /etc/hosts.

Quote from: Morta on November 18, 2021, 06:31:29 AM
You can use dnsmasq instead of unbound dns then add the ip and hostanme as shortname to /etc/hosts.

The same can be done in unbound on "Overrides"...
kind regards
chemlud
____
"The price of reliability is the pursuit of the utmost simplicity."
C.A.R. Hoare

felix eichhorns premium katzenfutter mit der extraportion energie

A router is not a switch - A router is not a switch - A router is not a switch - A rou....

Quote from: chemlud on November 18, 2021, 08:19:02 AM
Quote from: Morta on November 18, 2021, 06:31:29 AM
You can use dnsmasq instead of unbound dns then add the ip and hostanme as shortname to /etc/hosts.

The same can be done in unbound on "Overrides"...

Are they only affected after a reboot? Entries seems not work?!

So I tried using Unbound override option(see screenshot).

- The command "ping NAS" returns positively
- But trying "ping NAS" gets an error "ping: NAS2: Temporary failure in name resolution"

Did I not use override options correctly?

The "domain" field content is obviously broken. Should match your OPNsense domain.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Yes domain name was broken due to shoddy copy & paste. I fixed it but the result is still the same.

One question, the "host" field at the very start. What value gets specified here - the hostname as it currently registers with DHCP lease or the one that I want to be associated with this IP address? I've tried both options but neither works!

I got it to work and had to make two tweaks:

1. Leave the host name at the top of the screen blank
2. While testing I had to ping using NAS2.OPNSense.localdomain

And it worked  8)

If you send the opnsense.localdomain as the search domain to your clients via DHCP, then `ping nas2` should also work.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

@pmhausen
@Morta
@chemlud

Thanks for your inputs and pointing me in the right direction  :)