Bind9 / Ubuntu14

$ vi /etc/bind/named.conf
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
# コメント化
# include "/etc/bind/named.conf.default-zones";
# 追記
include "/etc/bind/named.conf.internal-zones";

$ vi /etc/bind/named.conf.internal-zones # 新規作成
# 内部向けの定義を記述
view "internal" {
# 指定範囲内のホストが内部向けの定義を参照
match-clients {
localhost;
192.168.11.0/24;
};
# 内部向け正引き情報を定義
zone "mitest.net" {
type master;
file "/etc/bind/mitest.net.lan";
allow-update { none; };
};
# 内部向け逆引き情報を定義 *注
zone "11.168.192.in-addr.arpa" {
type master;
file "/etc/bind/11.168.192.db";
allow-update { none; };
};
include "/etc/bind/named.conf.default-zones";

 

■正引きゾーンファイルの作成

# vi /etc/bind/mitest.net.lan
$TTL 86400
@ IN SOA ns1.mitest.net. root.mitest.net. (
2018012102 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
# ネームサーバー定義
@ IN NS ns1.mitest.net.
# ネームサーバーの内部アドレス
IN A 10.0.0.30
# メールエクスチェンジャ定義
IN MX 10 ns1.mitest.net.

# ホスト名に関連付けるIPアドレスを定義
ns1 IN A 192.168.11.200

 

■逆引きゾーンファイルの作成

$ vi /etc/bind/11.168192.db

$TTL 86400
@ IN SOA ns1.mitest.net. root.mitest.net. (
2018012102 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
# ネームサーバー定義
IN NS ns1.mitest.net.

# このドメインが属する範囲を定義
IN PTR mitest.net
IN A 255.255.255.0

# IPアドレスに関連付けるホスト名を定義
200 IN PTR ns1.mitest.net.

 

Apache2 / Ubuntu 17.04

1. Apache2 をインストールする。

root@www:~# apt -y install apache2

 

2. Apache2 の基本設定。

root@www:~# vi /etc/apache2/conf-enabled/security.conf

# 25行目:変更

ServerTokens Prod

 

root@www:~# vi /etc/apache2/mods-enabled/dir.conf

# 2行目:ディレクトリ名のみでアクセスできるファイル名を設定

DirectoryIndex index.html index.htm

root@www:~# vi /etc/apache2/apache2.conf

# 70行目:サーバー名追記

ServerName www.pidam.net

 

root@www:~# vi /etc/apache2/sites-enabled/000-default.conf

# 11行目:管理者アドレス変更

ServerAdmin webmaster@pidam.net

root@www:~# systemctl restart apache2 

 

3 動作確認。

http://(サーバーのホスト名またはIPアドレス)/」にアクセスして以下のようなページが表示されればOK。

f:id:cranberry1048:20180116225620p:plain

Bind9 / Ubuntu 17.04

1. BIND 9 をインストールする。

root@ubuntu:~# apt -y install bind9 bind9utils

 

2. BIND 9 の設定。

以下の設定は、グローバルアドレス [172.16.0.80/29], プライベートアドレス [10.10.0.0/24], ドメイン名 [pidam.net] の場合の例です。 適宜自身の環境に合わせて置き換えること。

root@ubutu:~# vi /etc/bind/named.conf

include "/etc/bind/named.conf.options";

include "/etc/bind/named.conf.local";

# コメント化

# include "/etc/bind/named.conf.default-zones";

# 追記

include "/etc/bind/named.conf.internal-zones";

include "/etc/bind/named.conf.external-zones";

 

root@ubuntu:~# vi /etc/bind/named.conf.internal-zones

# 新規作成

# 内部向けの定義を記述

view "internal" {

# 指定範囲内のホストが内部向けの定義を参照       

match-clients {

                localhost;

                10.10.0.0/24;

        };

# 内部向け正引き情報を定義

        zone "pidam.net" {

                type master;

                file "/etc/bind/pidam.net.lan";

                allow-update { none; };       

};

# 内部向け逆引き情報を定義 *注

        zone "0.10.10.in-addr.arpa" {

                type master;

                file "/etc/bind/0.10.10.db";

                allow-update { none; };        };

        include "/etc/bind/named.conf.default-zones";

};

root@ubuntu:~# vi /etc/bind/named.conf.external-zones

# 新規作成

# 外部向けの定義を記述

view "external" {

# 内部向け範囲以外のホストが参照        match-clients { any; };

# 問い合わせは全て許可        allow-query { any; };

# 再帰検索禁止        recursion no;

# 外部向け正引き情報を定義

        zone "pidam.net" {

                type master; 

                file "/etc/bind/pidam.net.wan";

                allow-update { none; };        };

# 外部向け正引き情報を定義 *注

        zone "80.1.16.172.in-addr.arpa" {

                type master;

                file "/etc/bind/80.1.16.172.db";

                allow-update { none; };        };

};

 

Apache httpd / CentOS6

1. httpd をインストールする。

[root@www ~]# yum -y install httpd


2. httpd の設定。サーバーの名前等は適宜自身の環境に置き換えること。

root@www ~]# vi /etc/httpd/conf/httpd.conf

# 44行目:変更ServerTokens Prod

# 76行目:キープアライブオンKeepAlive On

# 262行目:管理者アドレス指定ServerAdmin root@pidam.net

# 338行目:変更AllowOverride Al

l# 276行目:コメント解除しサーバー名指定ServerName www.pidam.net:80

# 402行目:ディレクトリ名のみでアクセスできるファイル名を追加

DirectoryIndex index.html index.htm

# 536行目:変更ServerSignature Off

[root@www ~]# /etc/rc.d/init.d/httpd start Starting httpd:     [ OK ]

[root@www ~]# chkconfig httpd on 

 

3. IPTables を有効にしている場合は、HTTP ポートの許可が必要。

HTTP は 80/TCP を使用。「-I INPUT 7」の箇所は適宜自身の環境を確認して、置き換えること。

[root@www ~]# iptables -I INPUT 7 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT 

 

Bind9 / CentOS7

BIND インストール/設定

名前解決サービスである DNS (Domain Name System) サーバーを構築します。

1. BIND をインストールします。
[root@centos7 ~]# yum -y install bind bind-chroot bind-utils


BIND起動/動作確認

1. BINDをchroot化して、起動します。
[root@centos7 ~]# /usr/libexec/setup-named-chroot.sh /var/named/chroot on

[root@centos7 ~]# systemctl stop named
[root@centos7 ~]# systemctl disable named

[root@centos7 ~]# systemctl start named-chroot
[root@centos7 ~]# systemctl enable named-chroot
ln -s '/usr/lib/systemd/system/named-chroot.service' '/etc/systemd/system/multi-user.target.wants/named-chroot.service'
[root@centos7 ~]#


2. Firewalld を有効にしている場合
DNS サービスの許可が必要

[root@centos7 ~]# firewall-cmd --add-service=dns --permanent
success
[root@centos7 ~]# firewall-cmd --reload
success

Juniper スイッチ系コマンド覚書

システムを再起動する
> request system reboot

システムをシャットダウンする
> request system power-off

システムを初期化する
reuest system zeroize

 

■ユーザ設定

rootユーザのパスワードを設定
root# set system root-authentication plain-text-password
New password:
Retype new password:

 

■システム設定

ホスト名の設定
root# set system host-name m_sw01

時刻設定
・Time zoneを指定する
root# set system time-zone Asia/Tokyo

・NTPサーバを指定する
root# set system ntp server 10.10.10.20

DNSサーバを指定する
root# set system name-server 10.10.10.30