02-08-2009 01:38 AM - edited 03-06-2019 03:55 AM
Can anybody give me the brief descrpition what is the use of the command ip name-server ?
02-08-2009 03:22 AM
Hi Sam
This is to tell the device ( be it a switch or router ) the IP address of the name server you want to use for DNS lookups.
Have you noticed when you mis type a command it says :-
Translating
If you specify a name server with that command, it will look up that entry in the name server you specified.
This can be useful if you have named your devices via DNS.
Say I have a router that I have a DNS entry for, I can just type that name at the command line and it will connect via telnet to that device.
Also, if I traceroute to an end point, each entry can be resovled if i use the ip name-server command.
As a little side note, you can stop that annoying feature of the device trying to translate a mistyped command by using the no domain lookup ( or ip domain lookup depending on IOS version ), but this will turn off ALL DNS lookups so don't use use ip name-server and then no ip domain lookup together ;-)
Hope that helps
02-08-2009 05:50 AM
Thank you I realy appreciate That information was quite useful and understandable
I want to ask you something,sometimes you know we put the command ip name-server with a public dns server such as ip name-server 212.117.*.* Acutally what is that and how it can resolve the names of device in a Private LAN
02-08-2009 06:29 AM
Hi Sam
Glad the info helped.
If your device can access the public IP, then you will be able to resolve what you need against that server or you can define an internal DNS server that you manage for DNS resolution. If you want to resolve internal hosts that do not have DNS entires you can use the ip host command as below : -
test(config)#ip host mybox 192.168.1.2
now I can telnet to 192.168.1.2 just by typing mybox
test#mybox
Translating "mybox"...domain server (255.255.255.255)
(255.255.255.255)Trying mybox (192.168.1.2)... Open
User Access Verification
Password:
Notice that it tried to resolve the name via DNS first which I could turn off with the no ip domain lookup command as below :-
test(config)#no ip domain lookup
test#mybox
Translating "mybox"
Trying mybox (192.168.1.2)... Open
User Access Verification
Password:
This is not as scalable as DNS but can be useful.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: