You can configure virtual routers to act as name resolvers for Domain Name Service (DNS).
DNS is a client/server mechanism that maps IP addresses to hostnames.
The name resolver is the client side of DNS and
receives address-to-hostname requests from its own clients when they
want to contact hosts on other networks. By polling name
servers, the name resolver learns name-to-address translations
for the hosts its clients want to contact.
A name server may provide the translation from
its cache or may poll servers lower in the DNS hierarchy to obtain
a translation. Typically, name servers at the top of the hierarchy
recognize top level domain names and know which servers to contact
for information about more detailed domain names. See Figure 24.
Figure 24: DNS Hierarchy Example
DNS messages from a name resolver to a name server
must include the domain name for the resolver’s clients. Consequently,
you must specify a default domain name for the clients. The default
domain name is appended to unqualified hostnames (those without domain
names).
The name resolver must be able to access at least
one name server. Accordingly, you must configure a static route to
a gateway that provides access to the name server and assign the name
server to the name resolver. For more information, see Assigning Name Servers.
Each virtual router can have its own name resolver
and domain name. However, if two virtual routers use the same name
servers and belong to the same local domain, you do not need to configure
name resolvers on both virtual routers. For more information, see Using One Name Resolver for Multiple Virtual Routers.
References
For more information about the DNS, consult the
following resources:
RFC 1035—Domain Names – Implementation and
Specification (November 1987)
RFC 2308—Negative Caching of DNS Queries (DNS NCACHE)
(March 1998)
Assigning Name Servers
To assign
name servers to the system:
Access the virtual router context.
Define static routes to the gateways that provide access
to the name servers.
Use to define a default domain name for the clients that
a name resolver serves.
You must define a default domain name for each name resolver.
Multiple name resolvers can use the same default domain name.
If you map an unqualified hostname (one without a domain
name) to an IP address with the host ftp command, the domain name is appended to the
hostname before the name is stored in the host table.
Example
host1(config)#ip domain-name bigcompany.com
Use the no version to delete
the domain name; that is, the domain name will no longer be appended
to hostnames in the static host table.
Using One Name Resolver for Multiple Virtual Routers
You can use one name resolver for multiple virtual
routers if those virtual routers use the same name servers and belong
to the same local domain. To do so, complete the following steps:
Configure a name resolver for the first virtual router.
Access the context for the second virtual
router.
Specify that the second virtual router should use the
name resolver you configured for the first virtual router.
Repeat Steps 2 and 3 for other virtual routers that you
want to point to this name resolver.
Example
To configure the virtual router boston to
use the same name servers as the default router, enter the following
commands.
After you configure DNS, you can use the show ip domain-lookup command to view information about
the name servers.
show ip domain-lookup
Use to display the name servers that you have specified
on the system with the ip name-server command.
Field descriptions
Bind to client—Name of the virtual router context
in parentheses, followed by the name of the virtual router providing
the name resolver
Using following Domain Name Servers—Name servers
you assigned
Using following Local Domain Names—Default domain
names you specified
Example—The virtual router boston uses the name resolver on the default virtual router.
host1#show ip domain-lookup
Bind to client: (boston)default
Using following Domain Name Servers:
10.2.0.3
11.1.1.1
10.1.1.1
1:2:3:4:5:6:7:8:9:0:a:b:c:d:e:f
Using following Local Domain Names :
urlofinterest.com
concord