LoginSignup
7
1

More than 5 years have passed since last update.

Raspberry PiでDNSサーバーを立てる

Last updated at Posted at 2017-08-09

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
7
1
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
7
1