Benches macOS

9

Cannot resolve host names on local network

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

It is a local network with router, few Windows computers with shared drives and one Mac.

Windows shares appear correctly in SHARED and can be used without any problems, like iTunes and iPhoto libraries are on those shared drives and work properly, even if ip address of those computers would change.

BUT - if I am trying to use VNC and connect to hostname:port, it says that server is not specified. If I try to ping hostname it says Unknown host.

At the same time, similar ping from Windows computer work without any problems.

It could be possible that router does not support something standard and communicates with Windows using something windows-specific, but what confuses me is that I can see computer names resolved in the finder already! Also, as I said iTunes and iPhoto can work with shared files on dynamic ip's which would be not possible if host names would be not resolved.

Thanks.

9 replies

Sign in or join Beachball Help to reply.

  1. 0

    ron App

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Really nobody knows how MacOS resolves host names? And where does it get computer names to display in "SHARED"?

    Thanks.

  2. 0

    Tim Haigh

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Domain Name Resolution for local IP addresses require a Local DNS server running on your network.

    Bonjour names will resolve without a Local DNS server. So this is why iTunes and iPhoto works as they use bonjour technology.

    A bonjour name ends in .local so in your macs sharing preferences you give the mac a name of imac its bonjour address is imac.local

    Other than that you are best giving your devices fixed IP address and adding there hostnames to your hosts file.

    the contents of /etc/hosts on your mac would look like

    ##

    # Host Database

    #

    # localhost is used to configure the loopback interface

    # when the system is booting. Do not change this entry.

    ##

    127.0.0.1 localhost

    255.255.255.255 broadcasthost

    ::1 localhost

    fe80::1%lo0 localhost

    so at the above that you could add for example

    192.168.1.5 mypc

    192.168.1.6 myprinter

    Then you could ping 192.168.1.5 by

    ping mypc

    So would have to add these entries to each hosts file on every computer on your lan.

    Or you could setup a local dns server and give each computer on your LAN a fully qualified domain name.

  3. 0

    ron App

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Thank you for the answers.

    Of course, I have DNS server (router) and Mac recognizes it as such, hence the question. Is router not a good DNS server? Windows machines are working OK with it, I can ping computers using their names. Could it be that routers commonly sold (like Dlink, Linksys, I have tried several of them with same result) are some kind of "windows routers" not really suitable for Mac?

    Regarding bonjour, are those computer names shown in "SHARED" in finder, discovered by bonjour?

    Then, it should be possible to say ping server.local and it should work, but it does not. Is there any way to let other applications (like vnc) to also use these bonjour names?

    Regarding "fully qualified domain name" I am a bit lost. Computers are in some workgroup, that workgroup shows in Mac's network setup. Is that not enough?

    Thanks.

  4. 0

    ron App

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    OK, it appears then, that MacOS is just not properly designed and therefore cannot resolve local names, which Windows machines can do without any problem.

    It just doesn't make sense that, being able to display host names in Finder, it is unable to use these names for say ping, or anything else.

  5. 0

    Eauboy

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I just had this same issue: Windows machines resolve local hosts via DNS but my Mac did not.

    The fix is simple; just add .local to the end of the hostname. So, instead of trying
    https://mynas/admin, you would use
    https://mynas.local/admin

    Worked great for me. I really didn't want to go the route (pun intended) of using IP address reservations, static host entries, etc.

  6. 0

    Tim Haigh

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    .local names only work if your windows machines are using bonjour.

  7. 0

    Tim Keating

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Is it just me, or is this really dumb?

    I mean, the Time Capsule is running a DHCP server... it has to dole out the IP addresses, and tracks the client ID. It's also running a DNS server, which hosts on the local network will use by default. So it has all the information it needs to automagically treat the client ID as a hostname... it just doesn't.

  8. 0

    Dogcow-Moof

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Which client ID are you speaking of?

    DHCP hands out an address to anyone that asks/is allowed and the server keeps track of them by MAC address among other things.

    There is no hostname <-> IP address mapping inherent in DHCP; that's what DNS is for.

  9. 0

    Tim Haigh

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    A Time Capsule does not run as a local dns server you configure it with an external DNS server IP or the IP of a local dns server.

    So on a network that does not have a local dns server you are reliant on bonjour domain names. Other than that you can configure your hosts file on your mac to customise domain name resolution.