no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


hosts_file [2015/08/06 20:47] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== Hosts File ======
  
 +  * [[DNS]]
 +
 +When looking up a domain name, the DNS request returns an IP address that the site is located at.
 +
 +You can override which IP address a domain is mapped to by editing your ''hosts'' file temporarily.
 +
 +To do this on OS X, open a Terminal session and run this command:
 +
 +<code>
 +sudo nano /etc/hosts
 +</code>
 +
 +Navigate to the bottom of the file with your keyboard, and add a new entry, in this syntax:
 +
 +<code>
 +1.2.3.4 domain.com
 +</code>
 +
 +Save your hosts file by pressing ''Control-O'' on your keyboard and then ''Enter''.
 +
 +You can exit the editor by pressing ''Control-X''.
 +
 +**In some cases,** your web browser caches DNS lookups for domains, so you will need to **completely quit out of your browser** and restart it for the changes to appear.

Navigation
QR Code
QR Code hosts_file (generated for current page)