使用yum安装bind软件包,不需确认、直接安装,其命令为[root@localhost~]# yum-________bind
时间: 2024-02-11 12:08:04 浏览: 151
使用yum安装bind软件包,不需确认、直接安装的命令为:
```
[root@localhost ~]# yum -y install bind
```
其中,yum是一个基于rpm包管理的软件包管理器,-y参数表示在安装软件包时不需要用户确认即可直接安装,install是安装软件包的命令,bind为需要安装的软件包名称。执行该命令后,会自动下载并安装bind软件包,无需用户确认。
相关问题
某校园网要架设一台主DNS服务器负责linux-xxx域(xxx为姓名拼音或首字母)的域名解析工作,服务器IP地址为192.168.1.学号。 要求:1、为以下域名实现正向和反向域名解析服务。 dns.linux-xxx.com 192.168.1.学号 mail.linux-xxx.com MX记录 192.168.1.180 study.linux-xxx.com 192.168.1.181 teach.linux-xxx.com 192.168.1.182 www.linux-xxx.com 192.168.1.183 2、配置从DNS服务器,IP地址为192.168.1.199 3、其它虚拟机设置以上主从DNS服务器测试正常。 4、windows主机设置以上主从DNS服务器测试正常。在Centos7完成这些要求,并给出具体步骤。
以下是在CentOS 7上完成这些要求的具体步骤:
1. 安装BIND软件包:
```
yum install bind bind-utils -y
```
2. 编辑主DNS服务器的配置文件`/etc/named.conf`,添加以下内容:
```
acl "trusted" {
192.168.1.0/24;
localhost;
};
options {
directory "/var/named";
recursion yes;
allow-query { trusted; };
forwarders { 8.8.8.8; };
};
zone "linux-xxx.com" IN {
type master;
file "linux-xxx.com.zone";
allow-update { none; };
};
zone "1.168.192.in-addr.arpa" IN {
type master;
file "1.168.192.in-addr.arpa.zone";
allow-update { none; };
};
```
3. 创建正向解析区域文件`/var/named/linux-xxx.com.zone`,添加以下内容:
```
$TTL 86400
@ IN SOA dns.linux-xxx.com. root.linux-xxx.com. (
2021100101; Serial
3600; Refresh after 3 hours
900; Retry after 15 minutes
604800; Expire after 1 week
86400); Minimum TTL of 1 day
@ IN NS dns.linux-xxx.com.
dns.linux-xxx.com. IN A 192.168.1.学号
mail.linux-xxx.com. IN MX 10 192.168.1.180
study.linux-xxx.com. IN A 192.168.1.181
teach.linux-xxx.com. IN A 192.168.1.182
www.linux-xxx.com. IN A 192.168.1.183
```
4. 创建反向解析区域文件`/var/named/1.168.192.in-addr.arpa.zone`,添加以下内容:
```
$TTL 86400
@ IN SOA dns.linux-xxx.com. root.linux-xxx.com. (
2021100101; Serial
3600; Refresh after 3 hours
900; Retry after 15 minutes
604800; Expire after 1 week
86400); Minimum TTL of 1 day
@ IN NS dns.linux-xxx.com.
学号 IN PTR dns.linux-xxx.com.
180 IN PTR mail.linux-xxx.com.
181 IN PTR study.linux-xxx.com.
182 IN PTR teach.linux-xxx.com.
183 IN PTR www.linux-xxx.com.
```
5. 启动并开机自启BIND服务:
```
systemctl start named
systemctl enable named
```
6. 编辑从DNS服务器的配置文件`/etc/named.conf`,添加以下内容:
```
options {
directory "/var/named";
recursion yes;
allow-query { any; };
};
zone "linux-xxx.com" IN {
type slave;
masters { 192.168.1.学号; };
file "slaves/linux-xxx.com.zone";
};
zone "1.168.192.in-addr.arpa" IN {
type slave;
masters { 192.168.1.学号; };
file "slaves/1.168.192.in-addr.arpa.zone";
};
```
7. 启动并开机自启BIND服务:
```
systemctl start named
systemctl enable named
```
8. 在其它虚拟机和Windows主机上配置主从DNS服务器的IP地址,测试解析是否正常。
注意:在上述步骤中,需要将其中的`linux-xxx.com`和`学号`替换为具体的域名和IP地址。在创建区域文件时,需要注意修改文件名和目录路径,以避免与已有文件重名。
阅读全文