Get the App
SLTechnology News&Howtos  ›  Servers  › 

Bind9 DNS configuration

Shulou Source: shulou.com Published: 2022-06-03 04:22:47 11月15日 Update

Purpose

Configure internal DNS

Version

Debian 9

Bind 9

Network configuration 192.168.11.200 (hogehoge.com) 192.168.11.205 (fugafuga.info)-required file configuration file/etc/bind/named.conf.localzone filehogehoge.com.internal-zonefugafuga.info.internal-zone168.192.in-addr.arpa.zonenamed.conf settings for DNS server

Invalidation of named.conf.default-zones file

Include "/ etc/bind/named.conf.options"; include "/ etc/bind/named.conf.local"; / / include "/ etc/bind/named.conf.default-zones"; named.conf.local setting view "internal" {match-clients {localhost; 192.168.0.0L16;}; zone "fugafuga.info" {type master File "/ etc/bind/fugafuga.info.internal-zone";}; zone "hogehoge.com" {type master; file "/ etc/bind/hogehoge.com.internal-zone";}; zone "168.192.in-addr.arpa" {type master File "/ etc/bind/168.192.in-addr.arpa.zone";};}; view

With view, some customers are provided with DNS. "matchclients" sets that customer.

Hogehoge.com.internal-zone sets $TTL 3600 @ IN SOA hogehoge.com. Hogehogemail.com. (20180723; Serial 3600; Refresh 1800; Retry 604800; Expire 86400; Minimum TTL) @ IN NS fugafuga.info.hogehoge.com. IN A 192.168.11.200 TTL

Time To Live-time to Live

SOA

Write your domain name and email address after SOA.

NS

Set up the DNS server.

A

Set the domain name and IP address.

Fugafuga.info.internal-zone sets $TTL 3600 @ IN SOA fugafuga.info. Hogehogemail.com. (20180723; Serial 3600; Refresh 1800; Retry 604800; Expire 86400; Minimum TTL) @ IN NS fugafuga.info.fugafuga.info. IN A 192.168.11.205168.192.in-addr.arpa.zone sets $TTL 3600 @ IN SOA fugafuga.info. Hogehogemail.com. (20180723; Serial 3600; Refresh 1800; Retry 604800; Expire 86400) Minimum TTL) @ IN NS fugafuga.info.11.200 IN PTR hogehoge.com.11.205 IN PTR fugafuga.info.PTR

Set the IP address and domain name.

Grammar check

Check configuration file and zone file with the named-checkconf command.

$/ usr/sbin/named-checkconf$ / usr/sbin/named-checkconf-zzone fugafuga.info/IN: loaded serial 20180723zone hogehoge.com/IN: loaded serial 20180723zone 168.192.in-addr.arpa/IN: loaded serial 20180723 restart bind$ sudo service bind9 restart network settings and restart the network $sudo vim / etc/network/interfaces (medium) dns-nameservers 192.168.11.205 8.8.8.8 (medium) sudo ifdown enp3s0 sudo ifup enp3s0

Tags: Address domain name configuration customer file server network service check command time version email email destination syntax mail Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn NVidia Shulou Tech Info MySQL OPPO Reno