1. 程式人生 > 其它 >四、配置前提(1)-安裝時間伺服器與dns伺服器

四、配置前提(1)-安裝時間伺服器與dns伺服器

4.1 配置時間伺服器。

[root@room8pc205 ~]# yum -y install chrony

server配置檔案(只需更改我寫出來的)

[root@room8pc205 ~]# vim /etc/chrony.conf

server ntp.aliyun.com iburst

bindacqaddress 0.0.0.0 #時間伺服器監聽地址(0.0.0.0表示所有地址)

allow 0/0

cmdallow 127.0.0.1

[root@room8pc205 ~]# systemctl restart chronyd.service

[root@room8pc205 ~]# chronyc sources –v

client 配置檔案

[root@client ~]# vim /etc/chrony.conf

server 192.168.1.105 iburst

cmdallow 127.0.0.1

[root@room8pc205 ~]# systemctl restart chronyd.service

4.2 配置轉發DNS伺服器

[root@room8pc205 桌面]# yum -y install bind-chroot

13listen-on port 53 { 192.168.1.105; };

14#listen-on-v6 port 53 { ::1; };

21allow-query { any; };

34forwarders { 61.139.2.69; };

35 dnssec-enable no;

36 dnssec-validation no;

[root@room8pc205 桌面]# systemctl restart named

測試

[root@room8pc205 桌面]# nslookup

> server 192.168.1.105

Default server: 192.168.1.105

Address: 192.168.1.105#53

> set q=a

> www.baidu.com

Server: 192.168.1.105

Address: 192.168.1.105#53

Non-authoritative answer:

www.baidu.com canonical name = www.a.shifen.com.

Name: www.a.shifen.com

Address: 14.215.177.39

Name: www.a.shifen.com

Address: 14.215.177.38

>

注:不能安裝在OpenStack服務上