Hosts File on XP
85What's a Hosts File Anyway?
The hosts file is a little file well hidden on computer. Most people don't know they have one. But one day you may need to know.. A hosts file basically controls how your browser finds websites.
Websites have an address just like you do you might live at 123 Main Street. There may be multiple people living at that address - but you are Bob at 123 Main Stree. If you were a website you would have an address too: it would be something like 72.14.221.132 in fact if you type that set of numbers straight into your browser you will come up to a well known site: google.com. One of google's addresses is 72.14.221.132 - its called an IP address and every site has one. Some IP addresses belong to only one site, others will have many websites on the same IP address.
Sometimes though you may want to tempoarily change a website's IP address which is when you need to find your hosts file.
How To Test a New Website Before its "Live"
Think of his scenario - you have an existing website - but you want to change it over a new a hosting provider.On that new hosting provider you want to build an entirely new website. You want to build it, play with it, decide its right BEFORE you swap your website over to its new hosting and new look.
To do this you need to edit the hosts file on your computer. Temporarily you want to see your new site while the rest of the world keeps on seeing the old site.
To do this you need to know two things - the new IP address of your website and where you hosts file is on your PC.
You should know what the IP address of your website is from your hosting account.
To find you hosts file may be a little more difficult! Common locations for Windows machines are:
Windows 95/98/Me: c:\windows\hosts
Windows NT/2000: c:\winnt\system32\drivers\etc\hosts
Windows XP (Home OR Pro): c:\windows\system32\drivers\etc\hosts
When you find that file you want to add a single line to it:
12.34.56.72 mywebsite.com www.mywebsite.com
where 12.34.56.72 is your NEW IP adress and mywebsite.com is your domain
Step By Step Editing Your Hosts File
Step-by-Step Editing a Hosts File
If you're not confident editing a hosts file then follow this video along step by step - until they open up the hosts file in notepad. Ignore the bit about pinging to get an IP address.
Just add the ext ra line with
<new IP> <website name>
save and close.
Close your browser if you have it open
Restart your browser
You should see your new site (if you don' try ctrl-F5 to clear the cache)
When Things Go Wrong
If you find lots and lots of lines in your hots file its probably just your spywear program blocking sites by adding lines like
127.0.0.0 badsite.com
This is fine - ignore them - just add your line in and save.
You will need adminstrator rights to edit the hosts file - login in as admin if you are not already.
Your file may be read only - right click and change this before you open it with wordpad
Don't use anything but a text editor on a text file - Word will add all types of invisible rubbish to the file even if you save as text.
Dont try to save as the file - "helpful" windows will insist on calling in hosts.txt which is NOT the name it has to be hosts no extension. If you want to keep a copy - copy hosts to hosts-old before you start and then edit hosts and "save" it not "save as".
Oh and once your site is moved over to the new hosting don't forget to delete this line! Or copy back the saved hosts file to hosts!
This hub is for Sue who builds quality log homes and taught me a lot about hosts files!
More For The Technically Challenged By Lissie
- Affordable Small Business Websites Domain Names
This article is a jargon free guide to getting your small business visible on the Internet. Having a useful website can be a fantastic way to get free traffic to your business. Visitors to your website can come visit any time of the day or night and - Online Business Models An Introduction
Don't do what I did - decide that I wanted to make money from home by making money online and start with a blank slate. Finally after 18 frustrating months I am starting to get there - but I wish I had read this article first - this is about why havi
PrintShare it! — Rate it: up down flag this hub
Comments
Thanks ajocor - its the 16th - but the first as "lissie"!
Thanks for such an informative hub Lissie. It scares me to consider doing this myself, even though I'm desperate to change providers for one of my websites. Must study this for a week or two to get the confidence to try it.
artspeck - it sounds difficult but its not really. Though if you are just changing hosting providers you don't need to do this - you need to change the nameservers to point to the new host - but that's another hub!
Great informative post as usual Lis. You are really a renesaunce woman. Dancing, computers, IM. What's next?
(I really wish they had a spell checker on these comments as you can see above, I actually meant renaissance, LOL)
Haha I know a horrible amount of basic unix from a long time ago -it was so painful learning it by trial and error - it always come back when I need to use it again - even if I havent' thought about it for years
In case anyone cares the reason that the hosts file has not extension is because on unix you don't have extensions - the OS is smart enough what to do with a file without an extension! Hosts has been around since at least the 1960s AFAIK - much longer than windows. Obviously someone took the concept straight over to Windows and didn't know that ever other file in Windows has an extension...Â
agrande - you forgot the travel, I speak a little Spanish and I can cook. I guess I'm the classic "student of everything master of none"!
Very informative, great hub!!!
This sounds less painful than some of the other instructions I have read. Good job. Thanks for sharing. Thumbs up!
I have no idea if I will ever need to do this myself. But even if not the information is invaluable.
When running businesses over the web, we should know about things like this, even if we don't have to do it ourselves. But I have also learned that a lot of this tech stuff is not so complicated, if you have good instructions, as you have provided
The Internet in the News
- Technology › NEC Biglobe to launch rental farm services using InternetJapan Today22 hours ago
Internet service provider NEC Biglobe Ltd will launch rental farm services using idled farms and the Internet in February next year. The company plans to…
- Google to buy mobile ad providerCNN Money1 second ago
Google said Monday that it plans to pay $750 million in stock for AdMob, a company that provides display advertising technology for mobile Internet sites.
- Internet Use Increases Social ConnectivityInformationWeek7 hours ago
Rather than pulling people away from each other, Internet use actually enhances the size and diversity of people's social networks, according to a Pew report.
- ANHL acquires rights to use iPayu mobile payments technologyFinextra3 hours ago
ANHL has completed the negotiations to acquire the rights to use the iPayu technology from iFinancial Systems, a privately-owned banking and payment ...
- Internet And Technology Don’t Lead To Social IsolationredOrbit4 days ago
A new study shows that contrary to popular belief, technology is not leading to social isolation, and Americans who use the Internet and mobile phones have larger and more diverse social networks, AFP reported.Keith Hampton, lead author of the report by the Pew Internet and American Life Project released Wednesday, said that all the evidence points in one direction: people's social worlds are ...
- Business Internet Savvy Seminar Planned Thursday In PurcellvilleLeesburg Today3 hours ago
Business owners interested in boosting their performance through greater use of the Internet can attend Thursday's seminar co-hosted by The Town of Purcellville and Virginia Farm Bureau Insurance at the Carver Center.
- Marlin & Associates Adds Senior Technology Banker, Afsaneh Naimollah, to Lead Its Technology Investment Banking PracticeMarketwire8 hours ago
NEW YORK, NY--(Marketwire - November 9, 2009) - Marlin & Associates New York LLC ("M&A"), the boutique investment banking firm specializing in acquisitions and divestitures of U.S. and international middle-market technology, information and business services firms, announced today that Afsaneh Naimollah has joined the firm's investment banking advisory team as a Partner, based in New York City ...
- Microsoft Corporation
Get product information, support, and news from Microsoft. - ZDNet: Tech News, Blogs and White Papers for IT Professionals
Where Technology Means Business: ZDNet delivers the best tech news, and resources for IT hardware, software, networking and services. It's the top site for IT managers and tech-savvy business people. - TechCrunch
Startup and Technology News
















ajcor says:
6 months ago
Thank you Lissie - see you're up to 114 hubs - how many have you done for the hub challenge? go well.....cheers