• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 新华三人才研学中心
  • 关于我们

H3C S5830V2[S5820V2]系列以太网交换机 典型配置举例-Release22xx系列-6W100

目录

19-域名解析典型配置举例

本章节下载 19-域名解析典型配置举例  (379.13 KB)

docurl=/cn/Service/Document_Software/Document_Center/Switches/Catalog/S5800/S5830V2/Configure/Typical_Configuration_Example/H3C_S5830V2[S5820V2]-Release22xx-6W100/201403/819585_30005_0.htm

19-域名解析典型配置举例


1  域名解析典型配置举例

1.1  简介

本章介绍了使用DNS功能实现域名解析的典型配置案例。

域名解析分为静态域名解析和动态域名解析,二者可以配合使用。在解析域名时,首先采用静态域名解析(查找静态域名解析表),如果静态域名解析不成功,再采用动态域名解析。由于动态域名解析可能会花费一定的时间,且需要域名服务器的配合,因而可以将一些常用的域名放入静态域名解析表中,这样可以大大提高域名解析效率。

1.2  IPv4静态域名解析典型配置举例

1.2.1  适用产品和版本

表1 配置适用的产品与软件版本关系

产品

软件版本

S5830V2&S5820V2系列以太网交换机

Release 2208P01

Release 2210

 

1.2.2  组网需求

图1所示,通过配置静态域名解析功能实现主机名host.com来代替使用IP地址访问Host。

图1 静态域名解析配置组网图

 

1.2.3  配置步骤

# 配置主机名host.com对应的IP地址为10.1.1.2。

<Switch> system-view

[Switch] ip host host.com 10.1.1.2

1.2.4  验证配置

# 执行ping host.com命令,Switch通过静态域名解析可以解析到host.com对应的IP地址为10.1.1.2

<Switch> ping host.com

  PING host.com (10.1.1.2):  56  data bytes, press CTRL_C to break

  56 bytes from 10.1.1.2: icmp_seq=0 ttl=128 time=1.000 ms

  56 bytes from 10.1.1.2: icmp_seq=1 ttl=128 time=1.000 ms

  56 bytes from 10.1.1.2: icmp_seq=2 ttl=128 time=1.000 ms

  56 bytes from 10.1.1.2: icmp_seq=3 ttl=128 time=1.000 ms

  56 bytes from 10.1.1.2: icmp_seq=4 ttl=128 time=2.000 ms

-- host.com ping statistics ---

5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss

round-trip min/avg/max/stddev = 1.000/1.200/2.000/0.400 ms

1.2.5  配置文件

#

 ip host host.com 10.1.1.2

#

1.3  IPv4动态域名解析典型配置举例

1.3.1  适用产品和版本

表2 配置适用的产品与软件版本关系

产品

软件版本

S5830V2&S5820V2系列以太网交换机

Release 2208P01

Release 2210

 

1.3.2  组网需求

图2所示,Switch 与DNS server之间、与host之间的通信正常,要求通过配置动态域名解析功能实现Switch利用DNS server进行域名解析,以达到通过域名访问主机的目的。

图2 动态域名解析组网图

 

1.3.3  配置步骤

1. 配置域名服务器

说明

不同域名服务器的配置方法不同,下面仅以Windows Server 2000为例,说明域名服务器的配置方法。

 

# 进入域名服务器配置界面。

在开始菜单中,选择[程序/管理工具/DNS]。

# 创建区域com。

图3所示,右键点击[正向查找区域],选择[新建区域],按照提示创建新的区域com。

图3 创建区域

 

# 添加域名和IP地址的映射。

图4所示,右键点击区域com。

图4 新建主机

 

选择[新建主机],弹出如图5的对话框。按照图5输入域名host和IP地址3.1.1.1。

图5 添加域名和IP地址的映射

 

2. Switch的配置

# 配置域名服务器的IP地址为2.1.1.2。

<Switch> system-view

[Switch] dns server 2.1.1.2

# 为简化访问主机时输入的域名,可以配置域名后缀com。

[Switch] dns domain com

1.3.4  验证配置

# 在设备上执行ping host命令,可以ping通主机,且对应的目的地址为3.1.1.1。

<Switch> ping host

Ping host.com (3.1.1.1): 56 data bytes, press CTRL_C to break

56 bytes from 3.1.1.1: icmp_seq=0 ttl=126 time=1.000 ms

56 bytes from 3.1.1.1: icmp_seq=1 ttl=126 time=1.000 ms

56 bytes from 3.1.1.1: icmp_seq=2 ttl=126 time=1.000 ms

56 bytes from 3.1.1.1: icmp_seq=3 ttl=126 time=1.000 ms

56 bytes from 3.1.1.1: icmp_seq=4 ttl=126 time=2.000 ms

 

--- Ping statistics for host ---

5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss

round-trip min/avg/max/std-dev = 1.000/1.200/2.000/0.400 ms

1.3.5  配置文件

#

 dns server 2.1.1.2

 dns domain com

#

1.4  IPv4域名解析典型综合配置举例

1.4.1  适用产品和版本

表3 配置适用的产品与软件版本关系

产品

软件版本

S5830V2&S5820V2系列以太网交换机

Release 2208P01

Release 2210

 

1.4.2  组网需求

图6所示,Switch A与DNS server之间、与Switch C之间、与host之间的通信正常,要求通过在Switch A上配置静态域名解析和动态域名解析功能实现将常用的域名Switch C放入静态域名解析表中以提高访问效率,将host域名放到DNS Server中以达到动态访问的目的。

图6 域名解析综合应用组网图

 

1.4.3  配置步骤

1. 配置域名服务器

域名服务器上的配置请参考1.3  IPv4动态域名解析典型配置举例

2. Switch A的配置

# 配置Switch C对应的IP地址为40.1.1.2。

<SwitchA> system-view

[SwitchA] ip host SwitchC 40.1.1.2

# 配置域名服务器的IP地址为20.1.1.1。

[SwitchA] dns server 20.1.1.1

# 为简化访问主机时输入的域名,可以配置域名后缀com。

[SwitchA] dns domain com

1.4.4  验证配置

# 执行ping SwitchC命令,Switch A通过静态域名解析可以解析到Switch C对应的IP地址为40.1.1.2

<SwitchA> ping SwitchC

Ping SwitchC (40.1.1.2): 56 data bytes, press CTRL_C to break

56 bytes from 40.1.1.2: icmp_seq=0 ttl=127 time=1.000 ms

56 bytes from 40.1.1.2: icmp_seq=1 ttl=127 time=1.000 ms

56 bytes from 40.1.1.2: icmp_seq=2 ttl=127 time=1.000 ms

56 bytes from 40.1.1.2: icmp_seq=3 ttl=127 time=1.000 ms

56 bytes from 40.1.1.2: icmp_seq=4 ttl=127 time=2.000 ms

 

--- Ping statistics for host.com ---

5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss

round-trip min/avg/max/std-dev = 1.000/1.200/2.000/0.400 ms

# 执行ping host命令,可以ping通主机,且对应的目的地址为30.1.1.1

[SwitchA] ping host

Ping host.com (30.1.1.1): 56 data bytes, press CTRL_C to break

56 bytes from 30.1.1.1: icmp_seq=0 ttl=127 time=1.000 ms

56 bytes from 30.1.1.1: icmp_seq=1 ttl=127 time=1.000 ms

56 bytes from 30.1.1.1: icmp_seq=2 ttl=127 time=1.000 ms

56 bytes from 30.1.1.1: icmp_seq=3 ttl=127 time=1.000 ms

56 bytes from 30.1.1.1: icmp_seq=4 ttl=127 time=2.000 ms

 

--- Ping statistics for host.com ---

5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss

round-trip min/avg/max/std-dev = 1.000/1.200/2.000/0.400 ms

1.4.5  配置文件

#

 dns server 20.1.1.1

 dns domain com

#

ip host SwitchC 40.1.1.2

#

1.5  IPv6静态域名解析典型配置举例

1.5.1  适用产品和版本

表4 配置适用的产品与软件版本关系

产品

软件版本

S5830V2&S5820V2系列以太网交换机

Release 2208P01

Release 2210

 

1.5.2  组网需求

图7所示,通过配置静态域名解析功能实现主机名host.com来代替使用IPv6地址访问Host。

图7 IPv6静态域名解析配置组网图

 

1.5.3  配置步骤

# 配置主机名host.com对应的IPv6地址为1::2。

<Switch> system-view

[Switch] ipv6 host host.com 1::2

1.5.4  验证配置

# 执行ping ipv6 host.com命令,Switch通过静态域名解析可以解析到host.com对应的IPv6地址为1::2。

<Switch> ping ipv6 host.com

Ping6(56 data bytes) 1::1 --> 1::2, press CTRL_C to break

56 bytes from 1::2, icmp_seq=0 hlim=128 time=1.000 ms

56 bytes from 1::2, icmp_seq=1 hlim=128 time=0.000 ms

56 bytes from 1::2, icmp_seq=2 hlim=128 time=1.000 ms

56 bytes from 1::2, icmp_seq=3 hlim=128 time=1.000 ms

56 bytes from 1::2, icmp_seq=4 hlim=128 time=0.000 ms

 

--- Ping6 statistics for host.com ---

5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss

round-trip min/avg/max/std-dev = 0.000/0.600/1.000/0.490 ms

1.5.5  配置文件

#

 ipv6 host host.com 1::2

#

1.6  IPv6动态域名解析典型配置举例

1.6.1  适用产品和版本

表5 配置适用的产品与软件版本关系

产品

软件版本

S5830V2&S5820V2系列以太网交换机

Release 2208P01

Release 2210

 

1.6.2  组网需求

图8所示,Switch 与DNS server之间、与host之间的通信正常,要求通过配置IPv6动态域名解析功能实现Switch利用DNS server进行域名解析,以达到通过域名访问主机的目的。

图8 IPv6动态域名解析配置组网图

 

1.6.3  配置步骤

1. 配置域名服务器

说明

不同域名服务器的配置方法不同,下面仅以Windows Server 2003为例,说明域名服务器的配置方法。配置之前,需确保DNS服务器支持IPv6 DNS功能,以便处理IPv6域名解析报文;且DNS服务器的接口可以转发IPv6报文。

 

# 进入域名服务器配置界面。

在开始菜单中,选择[程序/管理工具/DNS]。

# 创建区域com。

图9所示,右键点击[正向查找区域],选择[新建区域],按照提示创建新的区域com。

图9 创建区域

 

# 添加域名和IPv6地址的映射。

图10所示,右键点击区域com。

图10 创建记录

 

选择[其他新记录],弹出如图11的对话框,选择资源记录类型为“IPv6主机(AAAA)”。

图11 选择资源记录类型

 

按照图12输入域名host和IPv6地址1::1。点击<确定>按钮,添加域名和IPv6地址的映射。

图12 添加域名和IPv6地址的映射

 

2. Switch的配置

# 配置域名服务器的IPv6地址为2::2。

<Switch> system-view

[Switch] ipv6 dns server 2::2

# 为简化访问主机时输入的域名,可以配置域名后缀com。

[Switch] dns domain com

1.6.4  验证配置

# 在设备上执行ping ipv6 host命令,可以ping通主机,且对应的目的地址为1::1。

<Switch> ping ipv6 host

Ping6(56 data bytes) 3::1 --> 1::1, press CTRL_C to break

56 bytes from 1::1, icmp_seq=0 hlim=126 time=1.000 ms

56 bytes from 1::1, icmp_seq=1 hlim=126 time=0.000 ms

56 bytes from 1::1, icmp_seq=2 hlim=126 time=1.000 ms

56 bytes from 1::1, icmp_seq=3 hlim=126 time=1.000 ms

56 bytes from 1::1, icmp_seq=4 hlim=126 time=0.000 ms

 

--- Ping6 statistics for host ---

5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss

round-trip min/avg/max/std-dev = 0.000/0.600/1.000/0.490 ms

1.6.5  配置文件

#

 dns domain com

 ipv6 dns server 2::2

#

1.7  IPv6域名解析典型综合配置举例

1.7.1  适用产品和版本

表6 配置适用的产品与软件版本关系

产品

软件版本

S5830V2&S5820V2系列以太网交换机

Release 2208P01

Release 2210

 

1.7.2  组网需求

图13所示,Switch A与DNS server之间、与Switch C之间、与host之间的通信正常,要求通过在Switch A上配置静态域名解析和动态域名解析功能实现将常用的域名Switch C放入静态域名解析表中以提高访问效率,将host域名放到DNS Server中以达到动态访问的目的。

图13 IPv6域名解析综合应用组网图

1.7.3  配置步骤

1. 配置域名服务器

域名服务器上的配置请参考1.3  IPv4动态域名解析典型配置举例

2. Switch A的配置

# 配置Switch C对应的IP地址为4000::2。

<SwitchA> system-view

[SwitchA] ipv6 host SwitchC 4000::2

# 配置域名服务器的IP地址为2000::1。

[SwitchA] ipv6 dns server 2000::1

# 为简化访问主机时输入的域名,可以配置域名后缀com。

[SwitchA] dns domain com

1.7.4  验证配置

# 执行ping SwitchC命令,Switch A通过静态域名解析可以解析到Switch C对应的IP地址为4000::2

<SwitchA> ping ipv6 SwitchC

Ping6(56 data bytes) 1000::1 --> 4000::2, press CTRL_C to break

56 bytes from 4000::2, icmp_seq=0 hlim=127 time=1.000 ms

56 bytes from 4000::2, icmp_seq=1 hlim=127 time=0.000 ms

56 bytes from 4000::2, icmp_seq=2 hlim=127 time=1.000 ms

56 bytes from 4000::2, icmp_seq=3 hlim=127 time=1.000 ms

56 bytes from 4000::2, icmp_seq=4 hlim=127 time=0.000 ms

 

--- Ping6 statistics for host.com ---

5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss

round-trip min/avg/max/std-dev = 0.000/0.600/1.000/0.490 ms

# 执行ping host命令,可以ping通主机,且对应的目的地址为3000::1

[SwitchA] ping ipv6 host

Ping6(56 data bytes) 1000::1 --> 3000::1, press CTRL_C to break

56 bytes from 3000::1, icmp_seq=0 hlim=126 time=1.000 ms

56 bytes from 3000::1, icmp_seq=1 hlim=126 time=0.000 ms

56 bytes from 3000::1, icmp_seq=2 hlim=126 time=1.000 ms

56 bytes from 3000::1, icmp_seq=3 hlim=126 time=1.000 ms

56 bytes from 3000::1, icmp_seq=4 hlim=126 time=0.000 ms

 

--- Ping6 statistics for host ---

5 packet(s) transmitted, 5 packet(s) received, 0.0% packet loss

round-trip min/avg/max/std-dev = 0.000/0.600/1.000/0.490 ms

1.7.5  配置文件

#

 dns domain com

 ipv6 dns server 2000::1

#

ipv6 host SwitchC 4000::2

#

 

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!

新华三官网
联系我们