Share via


Can only access server via IP address, not hostname

Question

Wednesday, March 7, 2018 4:34 PM

I have a server running on a raspberry pi than can be accessed with a win 10 system browser (Chrome or Edge) via the IP address, but not via the hostname. 

I seem to have narrowed it down to nslookup finds it via the hostname but ping does not.

C:\Users\Mike\desktop>nslookup dimlights
Server:  router.asus.com
Address:  192.168.1.1

Name:    dimlights
Address:  192.168.1.62

**********************************************

C:\Users\Mike\desktop>ping dimlights
Ping request could not find host dimlights. Please check the name and try again.

So far I have updated the ASUS RT-N12D1 router firmware to the latest version, flushed the DNS cache with ipconfig /flushdns, and made sure there is no proxy involved.  I also tried it on Edge and Chrome.

Additional information: I can access the server with the IP address or the hostname using an iPhone, an Android phone, or a Mac running High Sierra. This is only a problem with Windows 10. The browser syntax being used is dimlights/

Ideas on what might be wrong?

PickyBiker

All replies (6)

Thursday, March 8, 2018 12:04 AM

Please try with the FQDN and see if that helps.

This posting is provided AS IS with no warranties or guarantees , and confers no rights.

Ahmed MALEK

My Website Link

My Linkedin Profile

My MVP Profile


Thursday, March 8, 2018 2:58 AM

Hi,

You could try to stop the DNS service and see whether this makes a difference.

In addition, you can try these commands to reinitialize various network states:

Reset WINSOCK entries to installation defaults : netsh winsock reset catalog

Reset TCP/IP stack to installation defaults : netsh int ip reset reset.log

Flush DNS resolver cache : ipconfig /flushdns (already tried)

Renew DNS client registration and refresh DHCP leases : ipconfig /registerdns

Flush routing table : route /f (reboot required)

You can also go to C:\WINDOWS\system32\drivers\etc\hosts , seeing if any caches exists there,delete them. Ping will look up in hosts file, then in DNS. 

Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].


Thursday, March 8, 2018 4:01 PM

It turns out that adding a DNS domain name of Home.Lan makes it work as expected. 

I can now connect to the server from Chrome on Win 10 by the IP address or the Hostname.

Thanks for all the suggestions.

PickyBiker


Thursday, March 8, 2018 5:07 PM

when you need to specify the FQDN, thats normaly a configuration in your router.
f.e.: How To Access Your Machines Using DNS Names with DD-WRT


Thursday, March 8, 2018 10:02 PM

So, it was a DNS suffix issue as I have highlighted above. Glad to see that this is fixed.

You can make sure that the proper DNS suffix is set to be distributed as part of your DHCP options.

This posting is provided AS IS with no warranties or guarantees , and confers no rights.

Ahmed MALEK

My Website Link

My Linkedin Profile

My MVP Profile


Friday, March 9, 2018 1:33 AM

Hi,

If you can mark the helpful suggestions as an answer, we can share the solutions with other communities.

Thanks in advanced.

Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].