Skip to main content
sudo not needed for "get" and the "newhostname" stuff is also not needed for "get". Also ensured that the "double-dash" was proper in the code snippets
Source Link

I've seen this happen when the local DNS server has DNS caching enabled, but doesn't flush the cache often enough (or at all).

You can set your Host Name/Computer Name to a static value using scutil in Terminal. This means that your Mac will no longer change it's name automatically, so it's important that there are no other machines on your network that actually have that hostname. When you run this, replace "new_hostname" with your desired hostname:

sudo scutil --set HostName new_hostname

sudo scutil --set LocalHostName new_hostname

sudo scutil --set ComputerName new_hostname

You can check to make sure the values are set by running:

sudo scutil --get HostName new_hostname

sudo scutil --get LocalHostName new_hostname

sudo scutil --get ComputerName new_hostname

Sources: man scutil

https://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man8/scutil.8.html

http://osxdaily.com/2010/09/06/change-your-mac-hostname-via-terminal/

I've seen this happen when the local DNS server has DNS caching enabled, but doesn't flush the cache often enough (or at all).

You can set your Host Name/Computer Name to a static value using scutil in Terminal. This means that your Mac will no longer change it's name automatically, so it's important that there are no other machines on your network that actually have that hostname. When you run this, replace "new_hostname" with your desired hostname:

sudo scutil -set HostName new_hostname

sudo scutil -set LocalHostName new_hostname

sudo scutil -set ComputerName new_hostname

You can check to make sure the values are set by running:

sudo scutil -get HostName new_hostname

sudo scutil -get LocalHostName new_hostname

sudo scutil -get ComputerName new_hostname

Sources: https://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man8/scutil.8.html

http://osxdaily.com/2010/09/06/change-your-mac-hostname-via-terminal/

I've seen this happen when the local DNS server has DNS caching enabled, but doesn't flush the cache often enough (or at all).

You can set your Host Name/Computer Name to a static value using scutil in Terminal. This means that your Mac will no longer change it's name automatically, so it's important that there are no other machines on your network that actually have that hostname. When you run this, replace "new_hostname" with your desired hostname:

sudo scutil --set HostName new_hostname

sudo scutil --set LocalHostName new_hostname

sudo scutil --set ComputerName new_hostname

You can check to make sure the values are set by running:

scutil --get HostName 

scutil --get LocalHostName 

scutil --get ComputerName 

Sources: man scutil

https://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man8/scutil.8.html

http://osxdaily.com/2010/09/06/change-your-mac-hostname-via-terminal/

edited body
Source Link
Jon Flaire
  • 111
  • 1
  • 3

I've seen this happen when the local DNS server has DNS caching enabled, but doesn't flush the cache often enough (or at all).

You can set your Host Name/Computer Name to a static value using scutil in Terminal. This meanmeans that your Mac will no longer change it's name automatically, so it's important that there are no other machines on your network that actually have that hostname. When you run this, replace "new_hostname" with your desired hostname:

sudo scutil –-set HostName new_hostname

sudo scutil –-set LocalHostName new_hostname

sudo scutil –-set ComputerName new_hostname

You can check to make sure the values are set by running:

sudo scutil –-get HostName new_hostname

sudo scutil –-get LocalHostName new_hostname

sudo scutil –-get ComputerName new_hostname

Sources: https://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man8/scutil.8.html

http://osxdaily.com/2010/09/06/change-your-mac-hostname-via-terminal/

I've seen this happen when the local DNS server has DNS caching enabled, but doesn't flush the cache often enough (or at all).

You can set your Host Name/Computer Name to a static value using scutil in Terminal. This mean that your Mac will no longer change it's name automatically, so it's important that there are no other machines on your network that actually have that hostname. When you run this, replace "new_hostname" with your desired hostname:

sudo scutil –-set HostName new_hostname

sudo scutil –-set LocalHostName new_hostname

sudo scutil –-set ComputerName new_hostname

You can check to make sure the values are set by running:

sudo scutil –-get HostName new_hostname

sudo scutil –-get LocalHostName new_hostname

sudo scutil –-get ComputerName new_hostname

Sources: https://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man8/scutil.8.html

http://osxdaily.com/2010/09/06/change-your-mac-hostname-via-terminal/

I've seen this happen when the local DNS server has DNS caching enabled, but doesn't flush the cache often enough (or at all).

You can set your Host Name/Computer Name to a static value using scutil in Terminal. This means that your Mac will no longer change it's name automatically, so it's important that there are no other machines on your network that actually have that hostname. When you run this, replace "new_hostname" with your desired hostname:

sudo scutil –-set HostName new_hostname

sudo scutil –-set LocalHostName new_hostname

sudo scutil –-set ComputerName new_hostname

You can check to make sure the values are set by running:

sudo scutil –-get HostName new_hostname

sudo scutil –-get LocalHostName new_hostname

sudo scutil –-get ComputerName new_hostname

Sources: https://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man8/scutil.8.html

http://osxdaily.com/2010/09/06/change-your-mac-hostname-via-terminal/

Source Link
Jon Flaire
  • 111
  • 1
  • 3

I've seen this happen when the local DNS server has DNS caching enabled, but doesn't flush the cache often enough (or at all).

You can set your Host Name/Computer Name to a static value using scutil in Terminal. This mean that your Mac will no longer change it's name automatically, so it's important that there are no other machines on your network that actually have that hostname. When you run this, replace "new_hostname" with your desired hostname:

sudo scutil –-set HostName new_hostname

sudo scutil –-set LocalHostName new_hostname

sudo scutil –-set ComputerName new_hostname

You can check to make sure the values are set by running:

sudo scutil –-get HostName new_hostname

sudo scutil –-get LocalHostName new_hostname

sudo scutil –-get ComputerName new_hostname

Sources: https://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man8/scutil.8.html

http://osxdaily.com/2010/09/06/change-your-mac-hostname-via-terminal/