|
#1
|
|||
|
|||
|
Do this if you want to preview your site on our servers without changing DNS.
You will need the domain name (eg: example.com, test.example.com) and the IP address of the target server. Make sure you close all open browser windows before doing this. Common locations of the 'hosts' file: 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 (you may need administrator access for Windows NT/2000/XP) NOTE: 'hosts' is the name of the file and not another directory name. It does not have an extension (eg: .exe, .txt, .doc, etc.) 1) Copy the location to your 'hosts' file from the respective Operating System above (copy only the bold area) 2) Open Windows Notepad (Start -> All Programs -> Accessories -> Notepad) 3) Click on the File menu and choose Open... 4) Paste that location into the File name: field and click the Open button 5) Start on a new line at the bottom of the file 6) Type the IP address, hit the TAB key, then type the domain* 7) Save the file and close all open browsers before attempting to browse to the domain. *You can add more than one hostname on the same line, just make sure you have at least one space or TAB in between each one. Example line: Code:
192.168.0.10 example.com test.example.com www.example.com Remember, this is only a temporary fix, so once your registrar has the updated information and DNS is fully propagated, you will need to remove any lines you added to the 'hosts' file. NOTE: this ONLY works on the computer where you changed the 'hosts' file. |
|
#2
|
|||
|
|||
|
Good thing to know!
|
|
#3
|
|||
|
|||
|
Just remember to remove it once the DNS has propagated!
I've lost count of the number of clients who have forgotten to do this and ran in to troubles later when an IP address changed, when they moved hosting once again or even when a test site moved to a live server! A PostIt Note on the monitor is a good thing! ~Dan |
|
#4
|
|||
|
|||
|
Since I'm on Linux as my main PC, I'd like to add this.
The syntax for the Linux host file is basically the same, so you would want to edit "/etc/hosts". I would use "sudo vim /etc/hosts", then add the line after the 127.0.1.1 line. After editing the hosts, I think you need to restart the computer, but I didn't need to. Just check the site, if it doesn't work then restart. |
|
#5
|
||||
|
||||
|
No, you don't need to do that (Windows).
__________________
quietFinn - netFinn Finland "Be who you are and say what you feel because those who mind don't matter and those who matter don't mind." - Dr. Seuss |
|
#6
|
|||
|
|||
|
I'll give the Mac OSX way. The file is edited the same way, I believe. To get to the file:
In the Finder, Go > Go to Folder Type: /private/etc/ Find the hosts file and edit. (Wouldn't be a bad idea to back up the file first.) |
|
#7
|
|||
|
|||
|
The 'hosts' file is a system file that is read each time the system does any DNS queries. It will check 'hosts' first, if what it's looking for is found it will use it and will not attempt to check with DNS; if not found in the 'hosts' file it will then check DNS.
A reboot (for any OS) is not required. If you didn't see the change in your browser then, most likely, you did not close all browser windows after making the change. Just close all open browsers and try again. |
|
#8
|
|||
|
|||
|
A restart is not necessary but its the simplest step you can take.
Or 1. Close out all existing IE windows. 2. In the command prompt type, netstat Adding a host file entry is very nice trick in development if the domain name has yet to propagate to the server holding your account. |
|
#9
|
||||
|
||||
|
Quote:
Simply edit the host file with the name of the offending server, add a non-existent ip and presto chango - no more annoying ads.
__________________
Affordable Telephone Counselling |
|
#10
|
||||
|
||||
|
Quote:
Several Windows utility sites have "pre-stocked" hosts files, with known nuisances already provided. I believe this site has one, with more detailed instructions for implementing it: AXCEL216 / MDGx MAX Speed WinDOwS Tricks + Secrets |
|
#11
|
||||
|
||||
|
Quote:
__________________
best regards, George |
|
#12
|
|||
|
|||
|
hi,
if iam not mistaken on Vista its at C:\Windows\System32\drivers\etc see ya, |
|
#13
|
||||
|
||||
|
Quote:
I still run both, although I only use IE on my old systems as required for certain educational app's. As for the Firefox extensions, they really are quite handy, especially Adblock Plus - which just so happens to be my personal favorite.
__________________
Affordable Telephone Counselling |
|
#14
|
||||
|
||||
|
One thing to note: if you're running Vista, editing the Hosts file is not as simple as in XP. Vista will tell you that you don't have permission to edit it.
Here's what to do:
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
|
|
All times are GMT -5. The time now is 03:08 AM.










