サイト検索

カテゴリー

 

2010 年 7 月
« 2 月    
 123
45678910
11121314151617
18192021222324
25262728293031

アーカイブ

named(bind 9.4.2)の設定

これは、以下の環境でDNSを設定する場合のメモです。

  1. FreeBSD 7.0 標準インストールの bind 9.4.2 を利用
  2. 設定するドメインは「herohero.org」
  3. プロバイダからは固定のグローバルIPアドレスを1個だけ取得
  4. インターネットへは、ブロードバンドルータを介して接続
  5. サーバ自体にはプライベート IP アドレスが割り当てられている
  6. スタティックNATによりサーバを公開
  7. DNS逆引きは非対応(プロバイダが対応していないため)
  8. スレーブの DNS はなし

/etc/named/named.conf を以下のように修正します(変更箇所だけ抜粋)。

(略)

// the proper IP address, or delete this option.
listen-on       { 192.168.xxx.yyy; };    // サーバのプライベートIPアドレスを指定

// If you have IPv6 enabled on this system, uncomment this option for

(略)

// benefit from its cache, thus reduce overall DNS traffic in the Internet.
// 「/*」を消す
forwarders {
192.168.xxx.zzz;    // プロバイダのDNS等を指定する
};
// 「*/」を消す
/*
* If there is a firewall between you and nameservers you want

(略)

zone “herohero.org” {              // 「herohero.org」ドメインを指定します
type master;                           // 「マスタ」として定義
file “master/herohero.org”;    // ドメイン情報は「master/herohero.org」ファイルで提供
notify no;                               // スレーブには通知しない(存在しない)
};

/etc/named/master/herohero.org を以下のように作成します(「sephiroth」が実ホスト名)。

;
$TTL 3D
@          IN      86400   SOA     sephiroth.herohero.org. root.herohero.org. (
; 「root.herohero.org」は「root@herohero.org」を表し、
; 管理者のメールアドレスを示します。
2008082501 ; serial このファイルを修正した場合はこの値を増加させます
10800 ; refresh
3600 ; retry
604800 ; expire
86400 ; default_ttl
)
;
IN      NS      sephiroth.herohero.org.            ; ネームサーバの指定
IN      MX      10      sephiroth.herohero.org.  ; メールサーバを指定
;
sephiroth IN      A            aaa.bbb.ccc.ddd
;「aaa.bbb.ccc.ddd」はグローバルIP
www IN      CNAME   sephiroth.herohero.org.
ventforet IN      CNAME   sephiroth.herohero.org.
; www、ventforet 等は、sephiroth の「別名」で定義します

/etc/resolve.conf を修正します。

domain  herohero.org
nameserver      192.168.xxx.yyy #サーバのIPアドレスを指定

/etc/rc.conf に、ブート時にnamedを自動起動するため以下を追加します。

named_enable=”YES”

手動でnamedを起動する場合は以下のコマンドを実行します。

/etc/rc.d/named start

以上で設定完了です。

コメントをどうぞ