DNS without domain

Started by verasense, March 15, 2021, 03:28:46 PM

Previous topic - Next topic
I used the "Register DHCP static mappings" to get the computer names into the DNS.

However:
ping computer1 cannot be resolved
But:
ping computer1.domain can.

Is there a way to allow DNS request without the domain?

Hi verasense,

maybe this depends on your client's operating system, too. Tell us about this and post the error messages of the two following commands:

ping <name>
nslookup <name>

Regards, Uwe

I am using Windows 10. The ping with the domain accesses the WAN address:

ping computer1
Ping request could not find host computer1. Please check the name and try again.

ping computer1.domain

Pinging computer1.domain[xx.xx.xx.xx] with 32 bytes of data:
Reply from xx.xx.xx.xx: bytes=32 time<1ms TTL=64
Reply from xx.xx.xx.xx: bytes=32 time<1ms TTL=64
...

nslookup computer1
Server:  computer1.domain
Address:  10.1.1.1

Name:    computer1
Addresses:  xx.xx.xx.xx
          192.168.10.1
          10.1.1.1
          192.168.0.1

Works on my system, just pinged the wife's pc just by hostname which does not have a dns override or static mapping.
OPNsense 24.7 - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member

What can be the reason for mine not to work?

Maybe the connection related / connection specific DNS-Suffix of your LAN/W-LAN connection of Windows 10? Your Client could or should attach ".domain" to "computer1" before pinging oder dns lookups. Inspect your network settings, maybe this helps or adapt your settings in the DHCP service static mappings.

You are right.

I tested it on Linux and it worked, it's not opnsense related.

On Windows, I could fix it via:
System - Advanced system settings - Computer Name - Change - More
and set "domain" in Primary DNS suffix of this computer.

Alternatively, this can aslo be done in the TCP/IP properties of the specific interface from the "Network Connections".

It is not the cleanest solution, as it is input manually and not obtained dynamically from the network.
I have the "Change primary DNS suffix..." option enabled so I am not sure why it is not picking the domain name from the DNS server. And I assigned a static DHCP lease, so it is supposed to get the domain from there...

See also: https://serverfault.com/questions/44030/local-dns-not-resolving-host-name-but-will-resolve-fqdn

March 16, 2021, 08:30:30 PM #7 Last Edit: March 16, 2021, 08:32:59 PM by wurmloch
Well, in general the client operating system should apply the domain suffix provided by the dhcp server. Opnsense offers this as default. Nevertheless in dhcp service setting you can explicitly specify in the field ,,domain" your domainname. Give it a try. And on windows cmd type ,,ipconfig -release" and ,,ipconfig -renew" to apply changes in dhcp Config. I agree, the a mix of dhcp Mapping and manually specified information is not good.

Somewhere above you spoke about ,,the Ping with the domain accesses the wan address" I do not understand this sentence.

And from my experience: keep your DNS in your network, on your servers and clients 100% correct, I repeat, 100%! Especially when windows is part of the game. And keep in mind that windows uses different mechanisms to resolve ip addresses for Ping and nslookup.

It's a good strategy to use different operating systems for testing :-)

And you can check opnsense unbound by using Interfaces: Diagnostics: DNS Lookup

Good luck, Uwe

Thanks for your help.

What I meant with "the Ping with the domain accesses the wan address" is that the ping command with explicit domain was using the WAN address out of all router addresses.
So, the router has 4 addresses (xx.xx.xx.xx, 192.168.10.1, 10.1.1.1, 192.168.0.1) and by using "ping computer1.domain" Windows used the WAN address out of them:
"Pinging computer1.domain[xx.xx.xx.xx] with 32 bytes of data:"

Maybe Windows picked this address at random from the DNS responses.