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

H3C交换机 典型配置举例-6W100

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

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

docurl=/cn/Service/Document_Software/Document_Center/Switches/Catalog/S10500/S10500/Configure/Typical_Configuration_Example/H3C_Typical_Configuration_Example-6W100/201312/807743_30005_0.htm

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


1  域名解析典型配置举例

1.1  简介

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

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

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

1.2.1  适用产品和版本

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

产品

软件版本

S10500系列以太网交换机

Release 1120系列,Release 1130系列,Release 1200系列

S5800&S5820X系列以太网交换机

Release 1808

S5830系列以太网交换机

Release 1115,Release 1118

S5500-EI&S5500-SI系列以太网交换机

Release 2220

 

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

    Reply from 10.1.1.2: bytes=56 Sequence=0 ttl=128 time=2 ms

    Reply from 10.1.1.2: bytes=56 Sequence=1 ttl=128 time=2 ms

    Reply from 10.1.1.2: bytes=56 Sequence=2 ttl=128 time=2 ms

    Reply from 10.1.1.2: bytes=56 Sequence=3 ttl=128 time=2 ms

    Reply from 10.1.1.2: bytes=56 Sequence=4 ttl=128 time=2 ms

 

  --- host.com ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 2/2/2 ms

1.2.5  配置文件

#

 ip host host.com 10.1.1.2

#

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

1.3.1  适用产品和版本

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

产品

软件版本

S10500系列以太网交换机

Release 1120系列,Release 1130系列,Release 1200系列

S5800&S5820X系列以太网交换机

Release 1808

S5830系列以太网交换机

Release 1115,Release 1118

S5500-EI&S5500-SI系列以太网交换机

Release 2220

 

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的配置

# 开启动态域名解析功能。

<Switch> system-view

[Switch] dns resolve

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

[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

 Trying DNS resolve, press CTRL_C to break

 Trying DNS server (2.1.1.2)

  PING host.com (3.1.1.1):

  56  data bytes, press CTRL_C to break

    Reply from 3.1.1.1: bytes=56 Sequence=0 ttl=126 time=3 ms

    Reply from 3.1.1.1: bytes=56 Sequence=1 ttl=126 time=1 ms

    Reply from 3.1.1.1: bytes=56 Sequence=2 ttl=126 time=1 ms

    Reply from 3.1.1.1: bytes=56 Sequence=3 ttl=126 time=1 ms

    Reply from 3.1.1.1: bytes=56 Sequence=4 ttl=126 time=1 ms

 

  --- host.com ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 1/1/3 ms

1.3.5  配置文件

#

 dns resolve

 dns server 2.1.1.2

 dns domain com

#

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

1.4.1  适用产品和版本

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

产品

软件版本

S10500系列以太网交换机

Release 1120系列,Release 1130系列,Release 1200系列

S5800&S5820X系列以太网交换机

Release 1808

S5830系列以太网交换机

Release 1115,Release 1118

S5500-EI&S5500-SI系列以太网交换机

Release 2220

 

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

# 开启动态域名解析功能。

[SwitchA] dns resolve

# 配置域名服务器的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

    Reply from 40.1.1.2: bytes=56 Sequence=1 ttl=126 time=2 ms

    Reply from 40.1.1.2: bytes=56 Sequence=2 ttl=126 time=2 ms

    Reply from 40.1.1.2: bytes=56 Sequence=3 ttl=126 time=2 ms

    Reply from 40.1.1.2: bytes=56 Sequence=4 ttl=126 time=2 ms

    Reply from 40.1.1.2: bytes=56 Sequence=5 ttl=126 time=2 ms

 

  --- SwitchC ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 2/2/2 ms

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

[SwitchA] ping host

 Trying DNS resolve, press CTRL_C to break

 Trying DNS server (20.1.1.1)

  PING host.com (30.1.1.1):

  56  data bytes, press CTRL_C to break

    Reply from 30.1.1.1: bytes=56 Sequence=1 ttl=126 time=3 ms

    Reply from 30.1.1.1: bytes=56 Sequence=2 ttl=126 time=1 ms

    Reply from 30.1.1.1: bytes=56 Sequence=3 ttl=126 time=1 ms

    Reply from 30.1.1.1: bytes=56 Sequence=4 ttl=126 time=1 ms

    Reply from 30.1.1.1: bytes=56 Sequence=5 ttl=126 time=1 ms

 

  --- host.com ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 1/1/3 ms

1.4.5  配置文件

#

 dns resolve

 dns server 20.1.1.1

 dns domain com

#

ip host host.com 40.1.1.2

#

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

1.5.1  适用产品和版本

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

产品

软件版本

S10500系列以太网交换机

Release 1120系列,Release 1130系列,Release 1200系列

S5800&S5820X系列以太网交换机

Release 1808

S5500-EI&S5500-SI系列以太网交换机

Release 2220

 

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

# 使能IPv6报文转发功能。

[Switch] ipv6

1.5.4  验证配置

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

<Switch> ping ipv6 host.com

  PING host.com (1::2):

  56  data bytes, press CTRL_C to break

    Reply from 1::2

    bytes=56 Sequence=0 hop limit=64  time = 3 ms

    Reply from 1::2

    bytes=56 Sequence=1 hop limit=64  time = 1 ms

    Reply from 1::2

    bytes=56 Sequence=2 hop limit=64  time = 1 ms

    Reply from 1::2

    bytes=56 Sequence=3 hop limit=64  time = 2 ms

    Reply from 1::2

    bytes=56 Sequence=4 hop limit=64  time = 2 ms

  --- host.com ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 1/1/3 ms

1.5.5  配置文件

#

 ipv6 host host.com 1::2

#

 ipv6

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

1.6.1  适用产品和版本

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

产品

软件版本

S10500系列以太网交换机

Release 1120系列,Release 1130系列,Release 1200系列

S5800&S5820X系列以太网交换机

Release 1808

S5500-EI&S5500-SI系列以太网交换机

Release 2220

 

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的配置

# 开启动态域名解析功能。

<Switch> system-view

[Switch] dns resolve

# 使能IPv6报文转发功能。

[Switch] ipv6

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

[Switch] dns server ipv6 2::2

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

[Switch] dns domain com

1.6.4  验证配置

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

<Switch> ping ipv6 host

 Trying DNS resolve, press CTRL_C to break

 Trying DNS server (2::2)

  PING host.com (1::1):

  56  data bytes, press CTRL_C to break

    Reply from 1::1

    bytes=56 Sequence=0 hop limit=60  time = 2 ms

    Reply from 1::1

    bytes=56 Sequence=1 hop limit=60  time = 1 ms

    Reply from 1::1

    bytes=56 Sequence=2 hop limit=60  time = 1 ms

    Reply from 1::1

    bytes=56 Sequence=3 hop limit=60  time = 1 ms

    Reply from 1::1

    bytes=56 Sequence=4 hop limit=60  time = 1 ms

 

  --- host.com ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 1/1/2 ms

1.6.5  配置文件

#

 dns resolve

 dns server ipv6 2::2

 dns domain com

#

ipv6

#

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

1.7.1  适用产品和版本

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

产品

软件版本

S10500系列以太网交换机

Release 1120系列,Release 1130系列,Release 1200系列

S5800&S5820X系列以太网交换机

Release 1808

S5500-EI&S5500-SI系列以太网交换机

Release 2220

 

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

# 使能IPv6报文转发功能。

[SwitchA] ipv6

# 开启动态域名解析功能。

[SwitchA] dns resolve

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

[SwitchA] dns server ipv6 2000::1

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

[SwitchA] dns domain com

1.7.4  验证配置

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

<SwitchA> ping ipv6 SwitchC

  PING SwitchC (1::2):

  56  data bytes, press CTRL_C to break

    Reply from 1::2

    bytes=56 Sequence=0 hop limit=63  time = 3 ms

    Reply from 1::2

    bytes=56 Sequence=1 hop limit=63  time = 1 ms

    Reply from 1::2

    bytes=56 Sequence=2 hop limit=63  time = 1 ms

    Reply from 1::2

    bytes=56 Sequence=3 hop limit=63  time = 2 ms

    Reply from 1::2

    bytes=56 Sequence=4 hop limit=63  time = 2 ms

  --- SwitchC ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 1/1/3 ms

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

[SwitchA] ping ipv6 host

 Trying DNS resolve, press CTRL_C to break

 Trying DNS server (2000::1)

  PING host.com (3000::1):

  56  data bytes, press CTRL_C to break

    Reply from 3000::1

    bytes=56 Sequence=0 hop limit=63  time = 2 ms

    Reply from 3000::1

    bytes=56 Sequence=1 hop limit=63  time = 1 ms

    Reply from 3000::1

    bytes=56 Sequence=2 hop limit=63  time = 1 ms

    Reply from 3000::1

    bytes=56 Sequence=3 hop limit=63  time = 1 ms

    Reply from 3000::1

    bytes=56 Sequence=4 hop limit=63  time = 1 ms

 

  --- host.com ping statistics ---

    5 packet(s) transmitted

    5 packet(s) received

    0.00% packet loss

    round-trip min/avg/max = 1/1/2 ms

1.7.5  配置文件

#

 dns resolve

 dns server ipv6 2000::1

 dns domain com

#

ipv6 host SwitchC 4000::2

#

ipv6

#

 

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

新华三官网
联系我们