DNSサーバーの構築
$ sudo apt-get install nsd
nsd.confを編集する
$ sudo nano /etc/nsd/nsd.conf
nsd.conf
# NSD configuration file for Debian.
#
# See the nsd.conf(5) man page.
#
# See /usr/share/doc/nsd/examples/nsd.conf for a commented
# reference config file.
#
# The following line includes additional configuration files from the
# /etc/nsd/nsd.conf.d directory.
# WARNING: The glob style doesn't work yet...
# include: "/etc/nsd/nsd.conf.d/*.conf"
server:
ip-address: 10.0.0.100 # my-ipaddress
database: "/var/db/nsd/nsd.db"
username: nsd
zone:
name: msrks.co.jp # my-fqdn
zonefile: /etc/nsd/msrsk.co.jp.zone # my-zonefile
zonefileを編集する
$ sudo nano /etc/nsd/msrks.co.jp.zone
msrks.co.jp.zone
$TTL 3600
@ IN SOA ns.example.com. root.msrks.co.jp.(
20170101;
3600;
900;
3600000;
3600;
)
IN NS ns.msrks.co.jp.
IN A 10.0.0.100
python.com IN A 10.0.0.201
ruby.com IN A 10.0.0.202
サービスの再起動
$ sudo systemctl restart nsd
$ sudo systemctl enable nsd