How to setup DNS server on Cisco routers
In environments of large networks is recommended to setup the router to use DNS to resolve computer names. Cisco routers enabled their default name resolution via DNS, but have not setup DNS server address used as the broadcast address (255.255.255.255) until you setup the DNS server address.
Subsequently, these commands can be accessed from the router to any computer through its name, if DNS servers do their jobs well.
For example, in case you want to do a simple test to www.yahoo.com:
The following command line is possible to identify the router sends a request to 172.16.1.10 DNS server and asks it to translate the name www.yahoo.com. The server responds with the IP address and then the ping will be held as usual.
The router will consult with both servers in order to make decisions. So that if the first server is not able to answer the request, then sends the request to the second server if the second server can not resolve the request, then the request fails:
For the information of the configured DNS servers, you can use the show hosts command:
The above command not only shows the DNS servers configured, also shows the domain name and DNS entries recently translated. The team names caches have been resolved recently. There is a difference between the domain names that the team learns the names dynamically and statically configured. The statically defined names are not deleted from the cache, while the dynamically learned are deleted after a certain period of time.
Defining a domain name on the router not only helps the team know your domain name, but also facilitates obtaining the domain names of the teams that are on your subnet, for example:
In doing so, you can use a classification such as ftp to reference the domain name server ftp.test.com. For organizations that use or possess more than one domain name, it is recommended to enter all names in the router:
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#ip domain-name test.com
Router1(config)#ip name-server 172.16.1.10
Router1(config)#ip name-server 10.1.20.51
Router1(config)#end
Router1#
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#ip domain-name test.com
Router1(config)#ip name-server 172.16.1.10
Router1(config)#ip name-server 10.1.20.51
Router1(config)#end
Router1#
Subsequently, these commands can be accessed from the router to any computer through its name, if DNS servers do their jobs well.
For example, in case you want to do a simple test to www.yahoo.com:
Router1#ping www.yahoo.com
Translating "www.yahoo.com"...domain server (172.16.1.10) [OK]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 67.195.160.76, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 80/91/104 ms
Router1#
Translating "www.yahoo.com"...domain server (172.16.1.10) [OK]
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 67.195.160.76, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 80/91/104 ms
Router1#
The following command line is possible to identify the router sends a request to 172.16.1.10 DNS server and asks it to translate the name www.yahoo.com. The server responds with the IP address and then the ping will be held as usual.
The router will consult with both servers in order to make decisions. So that if the first server is not able to answer the request, then sends the request to the second server if the second server can not resolve the request, then the request fails:
Router1#ping tos.com
Translating "toos.com"...domain server (172.16.1.10)(10.1.20.51)
% Unrecognized host or address, or protocol not running.
Router1#
Translating "toos.com"...domain server (172.16.1.10)(10.1.20.51)
% Unrecognized host or address, or protocol not running.
Router1#
For the information of the configured DNS servers, you can use the show hosts command:
Router1#show hosts
Default domain is test.com
Name/address lookup uses domain service
Name servers are 172.16.1.10, 10.1.20.51
Host Port Flags Age Type Address(es)
www.yahoo.com None (temp, OK) 0 IP 67.195.160.76
Router1#
Default domain is test.com
Name/address lookup uses domain service
Name servers are 172.16.1.10, 10.1.20.51
Host Port Flags Age Type Address(es)
www.yahoo.com None (temp, OK) 0 IP 67.195.160.76
Router1#
The above command not only shows the DNS servers configured, also shows the domain name and DNS entries recently translated. The team names caches have been resolved recently. There is a difference between the domain names that the team learns the names dynamically and statically configured. The statically defined names are not deleted from the cache, while the dynamically learned are deleted after a certain period of time.
Defining a domain name on the router not only helps the team know your domain name, but also facilitates obtaining the domain names of the teams that are on your subnet, for example:
Router1(config)#ip domain-name test.com
In doing so, you can use a classification such as ftp to reference the domain name server ftp.test.com. For organizations that use or possess more than one domain name, it is recommended to enter all names in the router:
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#ip domain-list test.com
Router1(config)#ip domain-list test2.com
Router1(config)#end
Router1#
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#ip domain-list test.com
Router1(config)#ip domain-list test2.com
Router1(config)#end
Router1#
0 Comments:
Post a Comment