5

Redhat 7 DNS安装与配置

 3 years ago
source link: https://blog.51cto.com/satantiantian/5680456
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Redhat 7 DNS安装与配置

推荐 原创

一、DNS介绍

DNS(Domain Name Server,域名解析服务)进行域名与相对应的IP地址转换的服务器,DNS中保存了一张域名和与之相对应的IP地址的表,用户使用域名地址,该系统就会自动把域名地址转为IP地址。

二、DNS功能配置

1、yum install bind bind-chroot     

#安装dns相关软件包;

Redhat 7 DNS安装与配置_域名解析

2、vim /etc/named.conf

# 127.0.0.1仅限制本机使用,修改成any;

Redhat 7 DNS安装与配置_dns_02

3、vim /etc/named.rfc1912.zones

#配置正向解析(即:根据名字解析IP);

Redhat 7 DNS安装与配置_ip地址_03

4、配置反向解析(即:根据IP解析名字);

Redhat 7 DNS安装与配置_dns_04

5、cd  /var/named

 cp  -a  named.localhost  named.test.com

 cp -a named.loopback named.192.168.16

#添加对应的文件;

6、vim /etc/named.test.com.conf

#修改正向解析文件;

Redhat 7 DNS安装与配置_dns_05

7、vim /etc/named.192.168.16

#修改反向解析文件;

Redhat 7 DNS安装与配置_ip地址_06

存盘,退出。反向解析结束。

三、DNS功能验证

1、vim /etc/resolv.conf

nameserver 192.168.16.100

#客户端使用DNS服务器作域名解析;

Redhat 7 DNS安装与配置_ip地址_07

2、用nslookup进行测试

 [root@Redhat ~]# nslookup

> www.test.com

Server:         192.168.16.100

Address:        192.168.16.100#53

Name:   www.tset.com

Address: 192.168.16.100

或者用ping,dig命令都可以

3、解析成功,dns服务器配置ok。

  • 2
  • 收藏
  • 评论
  • 分享
  • 举报

</div


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK