cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4365
Views
5
Helpful
3
Replies

ip name-server

samirshaikh52
Level 2
Level 2

Can anybody give me the brief descrpition what is the use of the command ip name-server ?

3 Replies 3

adamclarkuk_2
Level 4
Level 4

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 ...domain server (255.255.255.255).

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

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

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.

Getting Started

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: