bind9: MacPorts : Install

wolf:~ hide$ sudo port install bind9

—>  Fetching libxml2

—>  Attempting to fetch libxml2-2.7.3.tar.gz from ftp://fr.rpmfind.net/pub/libxml/

—>  Verifying checksum(s) for libxml2

—>  Extracting libxml2

—>  Configuring libxml2

—>  Building libxml2

—>  Staging libxml2 into destroot

—>  Installing libxml2 @2.7.3_0

—>  Activating libxml2 @2.7.3_0

—>  Cleaning libxml2

—>  Fetching bind9

—>  Attempting to fetch bind-9.6.1.tar.gz from ftp://ftp.epix.net/pub/isc/bind9/9.6.1

—>  Verifying checksum(s) for bind9

—>  Extracting bind9

—>  Configuring bind9

—>  Building bind9

—>  Staging bind9 into destroot

******************************************************

* To setup named to run, you need to copy named.conf.dist

* to named.conf:

* sudo cp /opt/local/etc/named.conf.dist /opt/local/etc/named.conf

* and edit as needed. If you use the default zone files for

* 127.0.0, localhost, and the cache, you also need to copy

* those files:

* sudo cp /opt/local/var/named/db.127.0.0.dist /opt/local/var/named/db.127.0.0

* sudo cp /opt/local/var/named/db.cache.dist /opt/local/var/named/db.cache

* sudo cp /opt/local/var/named/db.localhost.dist /opt/local/var/named/db.localhost

******************************************************

—>  Creating launchd control script

###########################################################

# A startup item has been generated that will aid in

# starting bind9 with launchd. It is disabled

# by default. Execute the following command to start it,

# and to cause it to launch at startup:

#

# sudo launchctl load -w /Library/LaunchDaemons/org.macports.bind9.plist

###########################################################

—>  Installing bind9 @9.6.1_0

—>  Activating bind9 @9.6.1_0

—>  Cleaning bind9

wolf:~ hide$ more /Library/LaunchDaemons/org.macports.bind9.plist

<?xml version=’1.0′ encoding=’UTF-8′?>

<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"

"http://www.apple.com/DTDs/PropertyList-1.0.dtd"; >

<plist version=’1.0′>

<dict>

<key>Label</key><string>org.macports.bind9</string>

<key>ProgramArguments</key>

<array>

        <string>/opt/local/bin/daemondo</string>

        <string>–label=bind9</string>

        <string>–start-cmd</string>

        <string>/opt/local/sbin/named</string>

        <string>-f</string>

        <string>;</string>

        <string>–restart-netchange</string>

        <string>–pid=exec</string>

</array>

<key>Debug</key><false/>

<key>Disabled</key><true/>

<key>OnDemand</key><false/>

<key>RunAtLoad</key><false/>

</dict>

</plist>

wolf:~ hide$ /opt/local/bin/daemondo  –help | more

daemondo, version 1.1

usage: daemondo [-hv] [–version]

                     –start-cmd prog args… ;

                     [–stop-cmd prog arg… ;]

                     [–restart-cmd prog arg… ;]

                     [–restart-wakeup]

                     [–restart-netchange]

daemondo is a wrapper program that runs daemons. It starts the specified

daemon on launch, stops it when given SIGTERM, and restarts it on SIGHUP.

It can also watch for transitions in system state, such as a change in

network availability or system power state, and restart the daemon on such

an event.

daemondo works well as an adapter between darwin 8’s launchd, and daemons

that are normally started via traditional rc.d style scripts or parameters.

Parameters:

  -h, –help                      Provide this help.

  -v                              Increase verbosity.

      –verbosity=n               Set verbosity to n.

  -V, –version                   Display program version information.

  -l, –label=desc                Label used to describe the daemon.

  -s, –start-cmd args… ;       Required: command that will start the daemon.

  -k, –stop-cmd args… ;        Command that will stop the daemon.

  -r, –restart-cmd args… ;     Command that will restart the daemon.

      –pid=none|exec|fileauto|fileclean

                                  Whether to use/how to treat pid file.

      –pidfile=<pidfile>         A pidfile from which to scavenge the target pid.

      –restart-wakeup            Restart daemon on wake from sleep.

      –restart-netchange         Restart daemon on a network change.

      –restart-config regex… ; SC patterns on which to restart the daemon.

      –restart-dist-notify names… ;

                                  Distributed Notification Center notifications

                                  on which to restart the daemon.

      –restart-darwin-notify names… ;

                                  Darwin Notification Center notifications

                                  on which to restart the daemon.

      –restart-config regex… ; SC patterns on which to restart the daemon.

daemondo responds to SIGHUP by restarting the daemon, and to SIGTERM by

stopping it. daemondo exits on receipt of SIGTERM, or when it detects

that the daemon process has died.

The arguments start-cmd, stop-cmd, restart-cmd, restart-config,

restart-dist-notify, and restart-darwin-notify, if present,

must each be followed by arguments terminated by a ‘;’. You may need to

escape or quote the ‘;’ to protect it from special handling by your shell.

daemondo runs in one of two modes: (1) If no stop-cmd is given, daemondo

executes start-cmd asyncronously, and tracks the process id; that process id

is used to signal the daemon for later stop and/or restart. (2) If stop-cmd

is given, then both start-cmd and stop-cmd are issued syncronously, and are

assumed to do all the work of controlling the daemon. In such cases there is

no process id to track. In either mode, restart-cmd, if present, is used to

restart the daemon. If in mode 1, restart-cmd must not disrupt the process id.

If restart-cmd is not provided, the daemon is restarted via a stop/start

sequence.

The argument restart-config specifies a set of regex patterns corresponding

to system configuration keys, on notification of change for which the daemon

will be restarted

The arguments restart-dist-notify and restart-darwin-notify specify a set of

notification names from the distributed and darwin notification centers,

respectively, on receipt of which the daemon will be restarted.

The argument restart-wakeup will cause the daemon to be restarted when the

computer wakes from sleep.

The argument restart-netchange will cause the daemon to be restarted when

the network configuration changes. This is a shortcut for the more

verbose –restart-darwin-notify com.apple.system.config.network_change.

In mode 1 only, daemondo will exit when it detects that the daemon being

monitored has exited.

wolf:~ hide$ named

wolf:~ hide$ sudo lsof -c named

Password:

COMMAND  PID USER   FD     TYPE    DEVICE  SIZE/OFF      NODE NAME

named   3548 root  cwd      DIR      14,2       170     21548 /private/var/named

named   3548 root  txt      REG      14,2   3305136   2429516 /usr/sbin/named

named   3548 root  txt      REG      14,2   1059792    695659 /usr/lib/dyld

named   3548 root  txt      REG      14,2 138440704   2589524 /private/var/db/dyld/dyld_shared_cache_i386

named   3548 root    0r     CHR       3,2       0t0 114770564 /dev/null

named   3548 root    1     PIPE 0x9515bc0     16384          

named   3548 root    2     PIPE 0x9515bc0     16384          

named   3548 root    3u    unix 0xb06caa0       0t0           ->0x6eb3dd0

named   3548 root    4u     CHR       3,2       0t0 114770564 /dev/null

named   3548 root    5u  KQUEUE                               count=0, state=0x2

named   3548 root    6r     CHR       8,0       0t0 115714948 /dev/random

named   3548 root   20u    IPv4 0xb9c8270       0t0       TCP 192.168.2.1:domain (LISTEN)

named   3548 root  512u    IPv4 0x6d48890       0t0       UDP 192.168.2.1:domain

wolf:etc hide$ more /private/etc/named.conf

//

// Include keys file

//

include "/etc/rndc.key";

// Declares control channels to be used by the rndc utility.

//

// It is recommended that 127.0.0.1 be the only address used.

// This also allows non-privileged users on the local host to manage

// your name server.

//

// Default controls

//

controls {

        inet 127.0.0.1 port 54 allow {any;}

        keys { "rndc-key"; };

};

options {

        directory "/var/named";

        /*

         * If there is a firewall between you and nameservers you want

         * to talk to, you might need to uncomment the query-source

         * directive below.  Previous versions of BIND always asked

         * questions using port 53, but BIND 8.1 uses an unprivileged

         * port by default.

         */

        // query-source address * port 53;

};

//

// a caching only nameserver config

//

zone "." IN {

        type hint;

        file "named.ca";

};

zone "localhost" IN {

        type master;

        file "localhost.zone";

        allow-update { none; };

};

zone "0.0.127.in-addr.arpa" IN {

        type master;

        file "named.local";

        allow-update { none; };

};

logging {

        category default {

                _default_log;

        };

        channel _default_log  {

                file "/Library/Logs/named.log";

                severity info;

                print-time yes;

        };

};

カテゴリー: 未分類 パーマリンク

コメントを残す

以下に詳細を記入するか、アイコンをクリックしてログインしてください。

WordPress.com ロゴ

WordPress.com アカウントを使ってコメントしています。 ログアウト / 変更 )

Twitter 画像

Twitter アカウントを使ってコメントしています。 ログアウト / 変更 )

Facebook の写真

Facebook アカウントを使ってコメントしています。 ログアウト / 変更 )

Google+ フォト

Google+ アカウントを使ってコメントしています。 ログアウト / 変更 )

%s と連携中