Windows Vista HOSTS File Location, Add Local DNS Entries to Windows Vista
Posted by alex in Insights at 3:28 AMIf you need to add a local DNS entry to your Windows Vista PC you will first need to know the location of the “hosts” file which is where you should add the local entries. It might be necessary to add local entries if you want to direct traffic from the Vista PC to a device on your local network by name instead of IP address.
Windows Vista hosts File Location: C:\Windows\System32\drivers\etc\hosts
The file will look something like the below by default.
Default Windows Vista hosts File:
# Copyright (c) 1993-2006 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a '#' symbol. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host 127.0.0.1 localhost ::1 localhost
If you want to add a custom DNS entry say to a printer on your network you would add a line similar to the below which would allow you to reach the printer by simply typing printer.
Windows Vista hosts File With Addition:
# Copyright (c) 1993-2006 Microsoft Corp. # # This is a sample HOSTS file used by Microsoft TCP/IP for Windows. # # This file contains the mappings of IP addresses to host names. Each # entry should be kept on an individual line. The IP address should # be placed in the first column followed by the corresponding host name. # The IP address and the host name should be separated by at least one # space. # # Additionally, comments (such as these) may be inserted on individual # lines or following the machine name denoted by a '#' symbol. # # For example: # # 102.54.94.97 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host 127.0.0.1 localhost ::1 localhost 192.168.1.201 printer
I used Notepad++ to modify the file though it can be done with the default notepad application installed on Windows Vista. If you do use the default notepad application then you will need to run notepad as the Administrator user which will allow you to modify the hosts file. In the example if you opened a command prompt and typed “ping printer” it should return a ICMP response from 192.168.1.201.
- How to Change Notepad++ Default File Save Location Changing the Notepad++ default file save location is easy but...
- Windows Vista Free Video to Screen Saver Converter, Convert WMV, AVI, MP4 to Vista Screensavers I had some of the Microsoft Vista Dream Scenes that...
- View Entire Google Toolbar Local Search History I was having trouble view Google Toolbar local search history...
- Import FileZilla Sites From the Site Configuration File On Windows XP or Windows Vista I recently had a laptop hard drive crash and needed...
- Modify a Users Path in Windows Vista: Vista Path Environment Variable Modifying a users PATH variable in Windows Vista is easy....
Tags: DNS, hosts, ICMP, Notepad, vista, windows
























Entries (RSS)
I am no stranger to the host file and I expected vista to work the same as you described. I am finding that when I make the entry and save it, then I ping the server I am defining, I get
“Ping request could not find host printer. Please check the
name and try again. ”
Any idea on why it isn’t working for me? I am running notepad and the command prompt as administrator. I’m also saving the host file correctly.
[Reply]
alex Reply:
March 1st, 2010 at 4:21 PM
Hello Thomas,
Were you able to get this resolved? If not could you post the contents of your hosts file below? I am curious to see the format.
Thanks.
alex
[Reply]