I have a small office network with a handful of Windows / Ubuntu machines of varying releases. A few days ago, one Windows machine lost the ability to access any services on the Ubuntu machines by hostname.
I can resolve the Ubuntu hostname using DNS:
C:\>nslookup gruit
Server: router.asus.com
Address: 192.168.73.1
Name: gruit
Address: 192.168.73.152
But, I cannot use things like ping
, ftp
, ssh
, etc. by hostname. For example:
C:\>ping gruit
Ping request could not find host gruit. Please check the name and try again.
I can successfully use the IP address with any of those commands:
C:\>ping 192.168.73.152
Pinging 192.168.73.152 with 32 bytes of data:
Reply from 192.168.73.152: bytes=32 time<1ms TTL=64
I can also use the hostname with a .
at the end:
C:\>ping gruit.
Pinging gruit [192.168.73.152] with 32 bytes of data:
Reply from 192.168.73.152: bytes=32 time<1ms TTL=64
This smacks of a NetBIOS issue. Indeed, things like NET VIEW
fail:
C:\>net view \\gruit
System error 53 has occurred.
The network path was not found.
Interestingly, though, NBT does resolve the hostname properly:
C:\>nbtstat -c
Ethernet0:
Node IpAddress: [192.168.73.104] Scope Id: []
NetBIOS Remote Cache Name Table
Name Type Host Address Life [sec]
------------------------------------------------------------
GRUIT <20> UNIQUE 192.168.73.152 592
For practical purposes, I don't care about NetBIOS/Samba/etc. on Ubuntu here; I just want my "normal" TCP/IP stuff to work (namely Postgres). Somehow, though, every client on this Windows 10 machine seems to use NetBIOS. If I clear the cache with nbtstat -R
, for example, then use some TCP/IP client (e.g. ssh
, psql
...), the NBT cache immediately shows the Ubuntu hostname and IP address again.
[EDIT: Some commands do not trigger an entry in the NBT cache. nslookup
never does. Neither do usual offenders (e.g. ping
) when I end the hostname with a dot.]
The real problem, of course, is that despite successfully resolving via both DNS and NBT, I can't actually use the hostnames with any client apps. I've read many conflicting doc pages, blogs, and forum posts about the name resolution order on Windows - and whether the client has a role in determining the resolution method. I'm not sure what's correct / current.
[nslookup
behavior in prior edit suggests that the client does have a role in choosing name resolution method. Not sure if it's explicit or incidental - e.g. which of several API functions they happen to call.]
For context:
- The problem machine is Windows 10; it has no
hosts
orlmhosts
file - The Ubuntu machines are 14.04 and 18.04
- All other Windows machines (all Windows 7) can access the Ubuntu servers by hostname, including for straight TCP/IP services and Samba-type services
- I've fixed a ton of other stuff throughout this odyssey (e.g. DHCP/DNS reconfig, OS upgrade, anti-malware/firewall upgrades and uninstalls, samba/systemd-resolved reconfig...); the network is in better shape than its ever been, other than this one remaining issue
Any ideas?