May 24, 2010 | HowTo

Normally when you want to access a server on the Internet, you specify its name, like “www.google.com”. What actually happens behind the scenes is that your computer finds out the “IP address” of where you want to go. The IP address is like the “telephone number” of a server. The IP address for Google is 64.233.181.104 .

Go ahead and try it, you’ll end up at Google.

If the IP address is a “telephone number”, then the name (like the name you enter for a number in your cell phone) is called a host name. “Host” is just another word for server or computer.

Anyway, normally all of this works automagically, and you don’t even notice it. Once in a while it may not, for example, in a home network, thus forcing you to type in numbers instead of names.

There’s a way to set hostnames to IP addresses manually.

The hosts file

It’s called a “hosts” file, and it works generally the same on Windows, Linux/Unix, and Mac OS/X.

The hosts file is a list of IP addresses followed by hostnames, separated by a space, like this:

64.233.181.104 www.google.com
192.168.0.4 myhomecomputer

By the way, there’s a neat little trick you can use to block ads by setting the address of adservers, like Double Click’s, to your local computer:

127.0.0.1 ad.doubleclick.net

Note: 127.0.0.1 is a special address that always refers to your own computer.

The hosts file’s location differs from system to system:

Setting hosts/IP address on Windows

On Windows 95, 98, and ME, the host file is at c:\windows\hosts .

On Windows NT, 2000, XP, Vista, and 7, it’s at C:\windows\system32\drivers\etc\hosts .

View your hosts file

You can modify it with Notepad (Accessories menu).

Setting hosts/IP address on Mac OS/X

In Mac OS X 10.2 or later, hosts is at /private/etc/hosts

To edit it, type this into a terminal (Applications > Utilities > Terminal)

sudo nano

Enter your own password if prompted, add a hostname entry, then press Ctrl+x to exit the editor, and save the modified file by pressing “y”.

You have to then flush the DNS cache (OS/X doesn’t do that automatically):

sudo dscacheutil -flushcache

More info: http://support.apple.com/kb/TA27291
http://www.leftcolumn.net/2009/07/04/adding-an-entry-to-etchosts-on-os-x/

Setting hosts/IP address on Linux/Ubuntu/Unix

On Linux and all other Unixes, hosts is at
/etc/hosts .

View your hosts file

You have to have either sudo or root privileges to edit it.


If you liked this article

If you liked this article, don’t forget to subscribe for updates!

Subscribe to New Articles by RSS or E-mail

Get updates by RSS (What’s RSS?)

Subscribe by email:

Follow me on Twitter


Top Incoming Search Terms

"how to" hosts linux /etc/host in windows /etc/host mac /etc/hosts comments /etc/hosts linux /private/etc/hosts add 5damaty.com add a local entry on /etc/host file linux add apple addresses in the hosts add dreamhost hostname os x add host entry automatically add host entry linux add host entry to linux add host in etc on windows add host ip add host ip address linux add host to mac os add host to terminal osx add host to windows add hostname in hosts linux add hostname in windows add hostname to os x add hosts in windows add hosts windows add ip address to host files add ip address to linux host add ip addresses to /private/etc/hosts mac add ip linux host file add ip to hostname entry in linux add ip to hosts file in linux add ips hosts osx adding host addresses osx adding ip to host file linux adding manual host names to osc apple ip youtube terminal hosts block doubleclick.net on mac os x block doubleclick.net osx cache:http://digitivity.org/964/how-to-manually-add-etc-host-ip-address-in-windows-linux-and-osx commentluv enabled comments in /etc/hosts linux etc/host etc/host mac etc/host mac os etc/host osx finding /etc/hosts macos manually hosts file on linux hosts linux hosts on linux similar to hosts file on windows how do i manually add a ip address how do you check what is the dns for 64.233.181.104 how to add a android phone to a linux domain how to add a host name in window how to add an entry into hosts how to add apple to hosts for windows how to add host name in xp how to add hostname in terminal how to add hosts on windows how to add ip address to linux host file how to add the host name in windows 7 how to check etc host on windows how to check the dns for 64.233.181.104 how to create ip address manually how to manually add a host ip address in windows 7 how to manually add hosts how to manually add hosts to windows 7 how to manually adding an ip on windows 7 how to manually enter a host name on a windows 7 computer how to manually set ip address in hosts file of windows operating system how to manually specify dns for mail how to manualy remove host files on a mac how-to add hostname in linux http://digitivity.org/964/how-to-manually-add-etc-host-ip-address-in-windows-linux-and-osx http://digitivity.org/964/how-to-manually-add-etc-host-ip-address-in-windows-linux-and-osx#comment-4927 http://www.bestgolfswingmechanics.com/ ip address manually linunx hostnames os x linux add hosts linux add terminal mac address linux facebok hosts linux howto add hosts linux ip address windows hosts locate linux manually add dns hosts lucid add to hosts lucid linux hostname etc/host mac "os x" howto edit etc hosts mac add ip in terminal mac etc/host mac hosts doubleclick mac hosts site:digitivity.org mac os x manually specify the ip of a hostname manual add host to dns manual add ip and host file manuall setting host address on os x manually add dns to linux host manually add host manually add host ip mac os manually add host ip ubuntu manually add host names mac os manually add ip address manually add windows hosts manually adding an entry into my hosts file for windows 7 manually set hostnames linux manually set ip address manually set the dns with hosts os x add hostnames os x block doubleclick.net osx /private/etc/hosts add osx dns manual setting terminal osx dns x-cache pctablets.abouts.us site:digitivity.org hosts site:http://digitivity.org sonyericssonarc.dk/ sudo nano add hosts terminal etc/host ubuntu add windows hosts ubuntu manually add domain name ubuntu where do i add hosts windows 7 add entry hosts windows etc host www.organic-seo.biz/ www.rehanahmad.org/ www.ro2a.com youtube host file on linux youtube ip etc hosts mac os x

Related posts:

  1. Microsoft (Finally) Wants You to Ditch IE6 If you've opened up Internet Explorer 6 recently (I only...
  2. My Windows XP Gets Virus Infected I got hit badly with some nasty viruses which ultimately...
  3. How to Install Miro Podcast Viewer on Windows Miro is a free and open source podcast viewer for...
  4. Microsoft Expression Web SuperPreview – BrowserCam for IE 6 and 8 If you design websites, you've probably had to view a...
  5. Frozen Bubble: A Fun and Addictive Marbles Game for Windows, Linux, and Mac Frozen Bubble is a fun game for wasting time while...

Explore related content: , , , , , ,

113 Responses to “How to Manually Add Hosts in Windows, Linux, and OS/X”

  1. Hello! I’ve been following your weblog for a while now and finally got the courage to go ahead and give you a shout out from Kingwood Texas! Just wanted to say keep up the excellent job!

  2. If I were you, I would check out this host: http://www.yasyf.com/hosting.html ! They have excellend products, are very cheap, and offer additional web design! You simply CAN’T miss them!

  3. Hey there, You’ve done a fantastic job. I will definitely digg it and personally recommend to my friends. I’m confident they’ll be benefited from this web site.

  4. ro2a says:

    good jop thanks 4 so

  5. رؤى says:

    good jop thanks 4 so :)

  6. شات says:

    i hope that 2 do in the future

  7. I loved as much as you will receive carried out right here. The sketch is tasteful, your authored subject matter stylish. nonetheless, you command get bought an shakiness over that you wish be delivering the following. unwell unquestionably come more formerly again since exactly the same nearly a lot often inside case you shield this hike.

  8. Cesar Poyser says:

    Just desire to say your article is as amazing. The clarity in your post is just spectacular and i can assume you are an expert on this subject. Well with your permission allow me to grab your RSS feed to keep updated with forthcoming post. Thanks a million and please carry on the gratifying work.

  9. excellenta estavr de mosos y entra con equir egubu. mofido a osforal y nônetos fancemono con ograpes rassento!

  10. I intended to compose you that very little remark so as to give many thanks once again about the amazing knowledge you’ve featured on this site. It was certainly wonderfully open-handed of you to make extensively all that many individuals could possibly have advertised as an electronic book to end up making some profit on their own, mostly since you could have done it in the event you wanted. These solutions as well acted as the easy way to fully grasp that some people have a similar passion similar to my very own to understand a lot more when considering this condition. I know there are numerous more fun sessions in the future for individuals who read your blog.

  11. Rosio Pasek says:

    Wonderful beat ! I would like to apprentice while you amend your web site, how can i subscribe for a blog web site? The account helped me a acceptable deal. I had been a little bit acquainted of this your broadcast offered bright clear concept

  12. Hello.This article was extremely interesting, particularly because I was looking for thoughts on this issue last Saturday.

  13. tribal Dress says:

    Wow, awesome blog layout! How long have you ever been running a blog for? you made blogging glance easy. The full look of your web site is wonderful, as neatly as the content!

Leave a Reply

CommentLuv Enabled