Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot resolve .local hostname after upgrading to macOS Sierra [closed]

I recently upgraded to macOS Sierra and i cannot resolve my .local hostnames anymore.

I've tried restoring the httpd.conf and httpd-vhosts.conf files, but it didn't help.

I can however reach my webserver using the IP address, but not with the .local hostname. If i ping the IP, it works perfectly, but pinging the hostname gives "Unknown host". Running "host mymac.local" gives Host server.local not found: 3(NXDOMAIN).

I also tried setting the ComputerName, HostName and LocalHostName with the scutil.

Obviously reboot didn't help either.

Anyone experiencing the same issue or have any idea how this could be resolved? Thanks a lot, very appreciated!

like image 478
user7014987 Avatar asked Oct 13 '16 17:10

user7014987


People also ask

How do you clear DNS on a Mac?

Here's how: Mac: Open System Preferences, select Network, Advanced, and then click the DNS tab. Select any DNS servers listed, and then tap the - button to remove them and apply your changes.


2 Answers

Open system preferences and in Sharing enable one of the services.

I'm not sure why this works but I'm assuming it has to do with Bonjour name resolving that's only enabled if at least one of the services are started.

Alternatively add it to your /etc/hosts file.

like image 135
sigget Avatar answered Oct 14 '22 14:10

sigget


Here is a solution that works for me on Mac OS Sierra.

  • Open System preferences
  • Open Sharing
  • Click 'edit...' computer name
  • Check 'Use dynamic global hostname'
  • Check 'Advertise services in domain using Bonjour'
  • Turn on 'file sharing'

Please see the attached image

like image 24
closure Avatar answered Oct 14 '22 14:10

closure