1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

自分用

Posted at

DNSキャッシュサーバーの構築
unboundのインストール
yum install unbound

dnsサービスへのアクセス許可
firewall-cmd —add-service dns
Firewall-cmd —runtime-to-permanent

鍵ファイルの作成
systemctl start unbound-keygen.service

設定ファイルの作成
Vim /etc/unbound/local.d/access-contorl.conf
#inter face
Interface: 127.0.0.1
Interface: 192.168..
#local network setting
Access-control: 127.0.0.1 allow
Access-control: 192.168.. allow
Access-control: 192.168.*.0/24

設定ファイルの確認
Unbound-checkconf

unboundの起動・永続化
Systemctl start unbound.service
Systemctl enable unbound.service

動作確認
Host www.yahoo.co.jp 192.168..

フォワーディングサーバーの構築
DNSキャッシュサーバー構築の手順を踏む
※設定ファイルのaccess-contorlのフォワーディングサーバーIPは除外する

設置ファイの作成
Vim /etc/unbound/conf.d/forward.conf
Forward-zone:
name: “.”
forward-addr: 192.168.. 転送先サーバーIP
forward-first: yes

Unboundサービスの再起動
Systemctl restart unbound.service

動作確認
Host www.yahoo.co.jp 192.168..

DNSコンテンツサーバーの構築(マスター)
Bindのインストール
Yum install bind

正引きゾーンデータベースファイルの作成
Vim /var/named/example.com.zone
$TTL 1D
@ IN SOA ns1.example.com. admin.ns1.example.com.(
2022012710 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
IN NS NS1.example.com.
IN NS NS2.example.com.
mail1 IN A 192.168.67.3
mail2 IN A 192.168.67.4
www IN A 192.168.67.5
ns1 IN A 192.168.67.139
ns2 IN A 192.168.67.142

@ IN MX 10 mail1.example.com.
IN MX 20 mail2.example.com.

IPv4用逆引きゾーンデータベースファイルの作成
Vim /var/named/example.com.rev
$TTL 1D
@ IN SOA ns1.example.com. admin.ns1.example.com.(
2022012710 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
IN NS NS1.example.com.
IN NS NS2.example.com.

3 IN PTR mail1.example.com.
4 IN PTR  mail2.example.com.
5 IN PTR www.example.com.
139 IN PTR ns1.example.com.
142 IN PTR  ns2.example.com.

ゾーンファイルの確認
Named-checkzone example.com example.com.zone
Named-checkzone 67.168.192.in-addr-arpa example.com.rev

マスタサーバの設定変更
Vim /etc/named.conf

Listen-on port 53 {127.0.0.1;
192.168.67.139; };
Allow-query { any; };
Recursion no;

zone "example.com" IN {
        type master;
        file "example.com.zone";
        allow-transfer{192.168.67.142;};
};

zone "67.168.192.in-addr.arpa" IN {
        type master;
        file "example.com.rev";
        allow-transfer{192.168.67.142;};
};

設定ファイルの確認
Named-checkconf

サービスの起動
Systemctl start named.service
Systemctl enable named.service

動作確認
Host www.example.com. 192.168.67.139
Host 192.168.67.3 192.168.67.139

DNSコンテンツサーバーの構築(スレーブ)
Bindのインストール
Yum install bind

スレーブサーバの設定
Vim /etc/named.conf

Listen-on port 53 {127.0.0.1;
192.168.67.142; };
Allow-query { any; };
Recursion no;

zone "example.com" IN {
        type slave;
        masters{
                192.168.67.139;
        };
       file "slaves/example.com.zone";
};

zone "67.168.192.in-addr.arpa" IN {
        type slave;
        masters{
                192.168.67.139;
        };
        file "slaves/example.com.rev";
};

設定ファイルの確認
Named-checkconf

サービスの起動
Systemctl start named.service
Systemctl enable named.service

動作確認
Ls -l /var/named/slaves
Host www.example.com. 192.168.67.142
Host 192.168.67.3 192.168.67.142

Webサーバーの構築
DNSサーバーの設定
Vim /var/named/example.com/zone
www IN A 192.168.67.5
Apacheのインストール
Yum install https

パケットフィルタリングの設定
Firewall-cmd —add-service=http
Firewall-cmd —add-service=https
Firewall-cmd —runtime-to-permanent

vim /etc/resolve.conf

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?