更改主机名
hostnamectl set-hostname gitlab.ai
安装DNS服务
yum -y install bind*
编辑主配置文件
vim /etc/named.conf
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
options {
directory "/var/named";
allow-recursion { 192.168.0.0/24; };
};
zone "." IN {
type hint;
file "named.ca";
};
zone "localhost" IN {
type master;
file "named.localhost";
allow-transfer { none; };
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.loopback";
allow-transfer { none; };
};
zone "oa.ai" IN {
type master;
file "oa.ai.zone";
allow-transfer { 192.168.0.200; };
};
/*zone "0.168.192.in-addr.arpa" IN {
type master;
file "0.168.192.in-addr";
allow-transfer { 192.168.0.200; };
};*/
zone "gitlab.ai" IN {
type master;
file "gitlab.ai.zone";
allow-transfer { 192.168.0.200; };
};
/*zone "100.168.192.in-addr.arpa" IN {
type master;
file "100.168.192.in-addr";
allow-transfer { 192.168.0.200; };
};*/
编辑子配置文件
cd /var/named/
vim 100.168.192.in-addr
$TTL 86400
@ IN SOA ns.oa.ai. root.oa.ai. (
2019012201
2H
5M
1D
6H)
IN NS ns.gitlab.ai.
254 IN PTR www.oa.ai.
vim oa.ai.zone
$TTL 86400
@ IN SOA ns.oa.ai. root.oa.ai. (
2019012202
2H
5M
1D
6H)
IN NS ns.gitlab.ai.
IN MX 10 mail
mail IN A 192.168.100.254
www IN A 192.168.100.254
oa.ai. IN A 192.168.100.254
*.oa.ai. IN A 192.168.100.254
ftp IN CNAME www
vim 0.168.192.in-addr
$TTL 86400
@ IN SOA ns.gitlab.ai root.gitlab.ai. (
2019012201
2H
5M
1D
6H)
IN NS ns.gitlab.ai.
200 IN PTR www.gitlab.ai.
vim gitlab.ai.zone
$TTL 86400
@ IN SOA ns.gitlab.ai. root.gitlab.ai. (
2019012202
2H
5M
1D
6H)
IN NS ns.gitlab.ai.
IN MX 10 mail
mail IN A 192.168.0.200
www IN A 192.168.0.200
gitlab.ai. IN A 192.168.0.200
*.gitlab.ai. IN A 192.168.0.200
ftp IN CNAME www
chown named.named /var/named/named.ca
chown named.named /var/named/oa.ai.zone
chown named.named /var/named/gitlab.ai.zone
systemctl enable named
systemctl start named