If 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.
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.
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