|
Article ID: 13
Last updated: 5 Mar, 2025
Sometimes you may need to test your domain while in the middle of a migration project. The easiest way to do this is by changing your HOSTS file and manually setting the IP and domain.
Windows
Mac OS X
sudo nano /private/etc/hosts Enter the administrator password when requested, you will not see it typed on screen as usual with the command line Once the hosts file is loaded within nano, use the arrow keys to navigate to the bottom of the hosts file to make your modifications When finished, hit Control+O followed by ENTER/RETURN to save changes to /private/etc/hosts, then hit Control+X to exit out of nano Quit out of Terminal when finished You can verify your hosts modifications immediately with ping, Safari, or any other network app. Changes take effect immediately though some adjustments may need to be accompanied by a DNS flush which can be done with the following command in OS X 10.9:dscacheutil -flushcache;sudo killall -HUP mDNSResponderWhen flushing DNS cache with that command you will need to enter the admin password.
This article was:
Report an issue
Article ID: 13
Last updated: 5 Mar, 2025
Views: 7814
|
Powered by KBPublisher Community (Knowledge base software)


Once the hosts file is loaded within nano, use the arrow keys to navigate to the bottom of the hosts file to make your modifications
When finished, hit Control+O followed by ENTER/RETURN to save changes to /private/etc/hosts, then hit Control+X to exit out of nano Quit out of Terminal when finished You can verify your hosts modifications immediately with ping, Safari, or any other network app. Changes take effect immediately though some adjustments may need to be accompanied by a DNS flush which can be done with the following command in OS X 10.9: