Simply append your new mappings underneath the default ones.
The hosts file contains some comments (lines starting with the # symbol), as well as some default hostname mappings (e.g. Open the hosts by typing on the Terminal that you have just opened: $ sudo nano /private/etc/hosts to redirect domains to local addresses.Įditing the hosts file in Mac OS X – Leopard, is a pretty easy task, especially if you are familiar with the terminal.Įither by start typing Terminal on the Spotlight, or by going into Applications -> Utilities -> Terminal. The hosts file can be edited to block certain hostnames (like ad-serving/malicious hosts), or used for web development purposes, i.e. Upon typing a url address on the browser, the system is checking if there is a relevant entry on the hosts file and gets the corresponding IP address, else it resolves the IP via the active connection’s DNS servers. The hosts file is a text file that maps hostnames to IP addresses.