1/19(缓存DNS、自定义YUM仓库、NTF时间同步)

缓存DNS
A:为真正的DNS服务器
B:缓存DNS服务器

yum -y install bind bind-chroot
vim /etc/named.conf
options {
directory “/var/named”;
forwarders { 192.168.4.7; }; #转发给192.168.4.7
};
systemctl restart named
nslookup www.lol.com 192.168.4.207

分离解析
能够区分客户机的来源地址
为不同类别的客户机提供不同的解析结果(IP地址)

自定义YUM仓库
仓库组成:1.众多的软件 2.仓库数据文件(仓库清单)
自定义仓库:将自己下载的RPM包创建为仓库

A:
关闭ssh的DNS查询
vim /etc/ssh/shhd_config

UseDNS no #修改此行内容,将注释去掉(把#去掉)

systemctl restart shhd #重启sshd服务

自定义Yum仓库开始
ls /root
tar -xf /root/tools.tar.gz -C /
ls /
ls /tools/
ls /tools/other/

createrepo /tools/other/ #生成仓库数据文件
ls /tools/other/

vim /etc/yum.repos.d/mydvd.repo
[mydvd]
name=centos7
baseurl=file:///mydvd
enabled=1
gpgcheck=0
[rpm] #唯一标识
name=myrpm
baseurl=file:///tools/other #指定Yum仓库的路径
enabled=1
yum repolist #列出仓库信息

更新自定义Yum仓库
1.更新yum的缓存(creatterepo --update)
2.更新仓库文件(yum makecache)

cp /mydvd/Packages/vsftpd-3.0.2-22.el7.x86_64.rpm /tools/other/
ls /tools/other/
creatterepo --update /tools/other
yum makecache
yum repolist

NTF时间同步
A:时间服务器
1.安装软件包chrony
yum -y install chrony
rpm -q chrony
2.修改配置文件
vim /etc/chrony.conf
#server 0.centos.pool.ntp.org iburst #与谁同步时间
#server 1.centos.pool.ntp.org iburst #iburst表示快速同步
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
26行 allow all #开头的#去掉,修改为允许所有客户端
29行 local stratum 10 #设置本机为第10层的时间服务器
3.重启时间服务
systemctl restart chronyd

B:客户端
1.安装软件包chrony
yum -y install chrony
2.修改配置文件
vim /etc/chrony.conf
server 192.168.4.7 iburst #与192.168.4.7同步时间
#server 1.centos.pool.ntp.org iburst #iburst表示快速同步
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
3.重启时间服务
systemctl restart chronyd

4.测试
date -s “2008-1-1”
date
systemctl restart chronyd
date
date
2020年 11月 19日 星期四 15:44:22 CST
[root@pc207 /]# chronyc sources -v #列出时间服务器信息

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值