読者です 読者をやめる 読者になる 読者になる

isseium's blog

田舎に住むWebエンジニアのブログ

bind (DNSサーバ構築)

bind(named)をよく理解していないので、とりあえず設定した項目のみ列挙。

/etc/named.conf

コメント化
    #listen-on port 53 { 127.0.0.1; }; 
    #listen-on-v6 port 53 { ::1; };
options 内に追加
    allow-query     { localhost; localnets; };
    allow-transfer { localhost; localnets; };
    allow-recursion { localhost; localnets; };

logging { } の下部に追加
view "internal" {
    match-clients {
        localhost;
        localnets;
    };
    match-destinations {
        localhost;
        localnets;
    };

    zone "." IN {
        type hint;
        file "named.ca";
    };

    include "/etc/named.rfc1912.zones";


    # 内部向け
    zone "mizuhataya.com" {
        type master;
        file "mizuhataya.com.db";
    };
    zone "11.168.192.in-addr.arpa" {
        type master;
        file "11.168.192.in-addr.arpa.db";
    };
};

/var/named/mizuhataya.com.db

google apps の設定含む

$TTL 86400
@   IN  SOA mizuhataya.com. moiroka.mizuhataya.com.(
    2010091301 ; Serial (YYYYMMDDNN)
    28800   ; Refresh
    14400   ; Retry
    3600000 ; Expire
    86400   ; Minimum
)

    IN  NS  mizuhataya.com.
*   IN  A   192.168.11.11
@   IN  A   192.168.11.11
        IN  MX 10   ASPMX.L.GOOGLE.COM.
        IN  MX 20   ALT1.ASPMX.L.GOOGLE.COM.
        IN  MX 20   ALT2.ASPMX.L.GOOGLE.COM.
        IN  MX 30   ASPMX2.GOOGLEMAIL.COM.
        IN  MX 30   ASPMX3.GOOGLEMAIL.COM.
        IN  MX 30   ASPMX4.GOOGLEMAIL.COM.
        IN  MX 30   ASPMX5.GOOGLEMAIL.COM.
google  IN  CNAME   ghs.google.com.

/var/named/11.168.192.in-addr.arpa.db

$TTL 86400
@   IN  SOA mizuhataya.com. moiroka.mizuhataya.com.(
    2010091301 ; Serial (YYYYMMDDNN)
    28800   ; Refresh
    14400   ; Retry
    3600000 ; Expire
    86400   ; Minimum
)

    IN  NS  mizuhataya.com.
*   IN  A   192.168.11.11
@   IN  A   192.168.11.11
        IN  MX 10   ASPMX.L.GOOGLE.COM.
        IN  MX 20   ALT1.ASPMX.L.GOOGLE.COM.
        IN  MX 20   ALT2.ASPMX.L.GOOGLE.COM.
        IN  MX 30   ASPMX2.GOOGLEMAIL.COM.
        IN  MX 30   ASPMX3.GOOGLEMAIL.COM.
        IN  MX 30   ASPMX4.GOOGLEMAIL.COM.
        IN  MX 30   ASPMX5.GOOGLEMAIL.COM.
google  IN  CNAME   ghs.google.com.