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:
- How-to Geek's Edit Your Hosts File
- CyberCiti's Flush DNS Cache
Written by James Barnett
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Linux
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#