OpenDNS and Local Host Names, a Work Around
Posted on March 30, 2007, under How To, Networking.
In a previous article entitled OpenDNS is a Better DNS, I explained some of the benefits to using OpenDNS. A brief recap for the boys a girls on what OpenDNS is:
OpenDNS uses its distributed network of DNS servers to speed up your Internet experience, increase reliability, improve security and make DNS smarter for users all over the world.
Since setting up OpenDNS on my networks router I have had some problems with local host names. For example my Network Attached Storage is called “NAS” appropriately. Well in some cases when using the logical name “NAS” to reference the box, it doesn’t work. I have to use the IP Address to access it. There is a relatively simple way to have the best of both worlds. The benefits of OpenDNS and the usefulness of being able to use host names.
What we are going to do in this work around is tell your host file to map logical names to certain IP Address. Your host file is used to look up the IP Address of a device on the network, a sort of mapping from IP Address to host name. So here we go:
1) Obtain the IP Addresses of the devices you want to map.
2) Navigate to “C:\WINDOWS\system32\drivers\etc” or “C:\WINNT\system32\drivers\etc” depending on your version of Windows.
3) Edit the file “hosts” in Notepad or your favorite text editor.
4) You want to add a line for every computer you wish to map in the form of “IP HOSTNAME” separated by a space. So if your IP Address was “192.168.1.50″ and your host name was “BigBadMachine” you would add a line like this “192.168.1.50 bigbadmachine”. Your host file would then look like this
[ftf]
# Copyright (c) 1993-1999 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
192.168.1.50 bigbadmachine
[/ftf]
5) You can add as many lines as you wish to the end. You will need to restart to see the results working.
This work around works best if you have static or “sticky” IP Addresses coming off of your router.
Popularity: 4% [?]


