Example for Configuring IPv6 DNS
Networking Requirements
As shown in Figure 10-3, RouterA functions as a DNS client and cooperates with a DNS server so that RouterA can access the host at fc00:2::1/64 using the domain name huawei.com.
Static IPv6 DNS entries of RouterB and RouterC are configured on RouterA so that RouterA can manage RouterB and RouterC.
Configuration Roadmap
The configuration roadmap is as follows:
Configure static DNS entries on RouterA to access RouterB and RouterC.
Configure the dynamic DNS resolution on RouterA to access the DNS server.
Procedure
- Configure RouterA.
# Configure IPv6 function.
<Huawei> system-view
[Huawei] sysname RouterA
[RouterA] ipv6
[RouterA] interface gigabitethernet 1/0/0
[RouterA-GigabitEthernet1/0/0] ipv6 enable
[RouterA-GigabitEthernet1/0/0] ipv6 address fc00:1::1/64
[RouterA-GigabitEthernet1/0/0] quit
# Configure static IPv6 DNS entries.
[RouterA] ipv6 host RouterB fc00:1::2
[RouterA] ipv6 host RouterC fc00:2::3
# Enable DNS resolution.
[RouterA] dns resolve
# Configure an IPv6 address for the DNS server.
[RouterA] dns server ipv6 fc00:3::2
# Set the domain name suffix to net.
[RouterA] dns domain net
# Set the domain name suffix to com.
[RouterA] dns domain com
[RouterA] quit
To resolve the domain name, you need to configure the routes from RouterA to the IPv6 DNS server, RouterB, and RouterC. For details on how to configure a route, see Configure static route example in the Configuration Guide-IP Routing.
- Verify the configuration.
# Run the ping ipv6 huawei.com command on RouterA. You can find that the ping operation succeeds, and the destination IPv6 address is fc00:2::1.
<RouterA> ping ipv6 huawei.com Resolved Host ( huawei.com -> FC00:2::1) PING huawei.com : 56 data bytes, press CTRL_C to break Reply from FC00:2::1 bytes=56 Sequence=1 hop limit=64 time = 1 ms Reply from FC00:2::1 bytes=56 Sequence=2 hop limit=64 time = 1 ms Reply from FC00:2::1 bytes=56 Sequence=3 hop limit=64 time = 1 ms Reply from FC00:2::1 bytes=56 Sequence=4 hop limit=64 time = 1 ms Reply from FC00:2::1 bytes=56 Sequence=5 hop limit=64 time = 1 ms --- huawei.com ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 1/1/1 ms
# Run the display ipv6 host command on RouterA. You can view mappings between host names and IPv6 addresses in static DNS entries.
<RouterA> display ipv6 host Host Age Flags IPv6Address (es) RouterB 0 static FC00:1::2 RouterC 0 static FC00:2::3
# Run the display dns ipv6 dynamic-host command on RouterA. You can view information about dynamic IPv6 DNS entries saved in the cache.
<RouterA> display dns ipv6 dynamic-host Host TTL Type Address(es) huawei.com 3579 IPv6 FC00:2::1
The TTL field in the command output indicates the lifetime of a DNS entry, in seconds.
Configuration File
Configuration file of RouterA
# sysname RouterA # ipv6 # ipv6 host RouterB FC00:1::2 ipv6 host RouterC FC00:2::3 # dns resolve dns server ipv6 FC00:3::2 dns domain net dns domain com # interface GigabitEthernet1/0/0 ipv6 enable ipv6 address FC00:1::1/64 # ipv6 route-static FC00:2:: 64 FC00:1::2 ipv6 route-static FC00:3:: 64 FC00:1::2 # return
Configuration file of RouterB
# sysname RouterB # ipv6 # interface GigabitEthernet2/0/0 ipv6 enable ipv6 address FC00:2::2/64 # interface GigabitEthernet1/0/0 ipv6 enable ipv6 address FC00:1::2/64 # ipv6 route-static FC00:3:: 64 FC00:2::3 # return
Configuration file of RouterC
# sysname RouterC # ipv6 # interface GigabitEthernet2/0/0 ipv6 enable ipv6 address FC00:2::3/64 # interface GigabitEthernet1/0/0 ipv6 enable ipv6 address FC00:3::1/64 # ipv6 route-static FC00:1:: 64 FC00:2::2 # return