Last Updated: February 25, 2016
·
1.199K
· barnettjw

Edit Hosts File

Edit Hosts File

Windows

  • Start Menu --> Notepad --> Right-click Run as Administrator
  • Open file %systemroot%\system32\drivers\etc\hosts

OS X

sudo nano /private/etc/hosts

Linux

nano /etc/hosts

Flush DNS

If you are editing your host file to test a website before changing your DNS you probably want to flush the IP of your old site from your DNS cache after adding the new test entry.

Windows

ipconfig /flushdns

OS X

dscacheutil -flushcache

Ubuntu

sudo /etc/init.d/nscd restart

RHEL & Fedora

service nscd reload

Debian

service nscd restart

More Details: