hdknr’s posterous

 
Filed under

powerdns

 

poweradmin: いい加減なTDLのゾーンを作れるようにする。$dns_strict_tld_check = 0

hdknr@mailjail:/home/www/sites/jail.hdknr.deb/poweradmin-2.1.3$ find . -name "*.php" -exec grep -H "You are using an invalid top level domain" {} \;
./inc/error.inc.php:define("ERR_DNS_INV_TLD", _('You are using an invalid top level domain.'));

hdknr@mailjail:/home/www/sites/jail.hdknr.deb/poweradmin-2.1.3$ find . -name "*.php" -exec grep -H "ERR_DNS_INV_TLD" {} \;./inc/error.inc.php:define("ERR_DNS_INV_TLD", _('You are using an invalid top level domain.'));
./inc/dns.inc.php:        error(ERR_DNS_INV_TLD); return false;

hdknr@mailjail:/home/www/sites/jail.hdknr.deb/poweradmin-2.1.3$ vi inc/dns.inc.php

function is_valid_hostname_fqdn($hostname, $wildcard) {

        global $dns_strict_tld_check;
        global $valid_tlds;

        $hostname = ereg_replace("\.$","",$hostname);

        if (strlen($hostname) > 255) {
                error(ERR_DNS_HN_TOO_LONG);
                return false;
        }

        $hostname_labels = explode ('.', $hostname);
        $label_count = count($hostname_labels);

        foreach ($hostname_labels as $hostname_label) {
                if ($wildcard == 1 && !isset($first)) {                        if (!preg_match('/^(\*|[\w-\/]+)$/',$hostname_label)) { error(ERR_DNS_HN_INV_CHARS); return false; }
                        $first = 1;
                } else {
                        if (!preg_match('/^[\w-\/]+$/',$hostname_label)) { error(ERR_DNS_HN_INV_CHARS); return false; }
                }
                if (substr($hostname_label, 0, 1) == "-") { error(ERR_DNS_HN_DASH); return false; }
                if (substr($hostname_label, -1, 1) == "-") { error(ERR_DNS_HN_DASH); return false; }
                if (strlen($hostname_label) < 1 || strlen($hostname_label) > 63) { error(ERR_DNS_HN_LENGTH); return false; }
        }

        if ($hostname_labels[$label_count-1] == "arpa" && (substr_count($hostname_labels[0], "/") == 1 XOR substr_count($hostname_lab
els[1], "/") == 1)) {
                if (substr_count($hostname_labels[0], "/") == 1) {
                        $array = explode ("/", $hostname_labels[0]);
                } else {
                        $array = explode ("/", $hostname_labels[1]);
                }
                if (count($array) != 2) { error(ERR_DNS_HOSTNAME) ; return false; }
                if (!is_numeric($array[0]) || $array[0] < 0 || $array[0] > 255) { error(ERR_DNS_HOSTNAME) ; return false; }
                if (!is_numeric($array[1]) || $array[1] < 25 || $array[1] > 31) { error(ERR_DNS_HOSTNAME) ; return false; }
        } else {
                if (substr_count($hostname, "/") > 0) { error(ERR_DNS_HN_SLASH) ; return false; }
        }


        if ($dns_strict_tld_check == "1" && !in_array($hostname_labels[$label_count-1], $valid_tlds)) {
                error(ERR_DNS_INV_TLD); return false;
        }

        return true;
}

hdknr@mailjail:/home/www/sites/jail.hdknr.deb/poweradmin-2.1.3$ sudo vim inc/config.inc.php

$dns_strict_tld_check   = 0 ;

   
Click here to download:
poweradmin_TDLdns_strict_tld_c.zip (149 KB)

Filed under  //   poweradmin   powerdns  

Comments [0]

powerdns: prepare database tables for mysql backend

hdknr@mailjail:/home/www/sites/jail.hdknr.deb/poweradmin-2.1.3/sql$ cat
mysql.sql
CREATE TABLE domains (
id INT auto_increment,
name VARCHAR(255) NOT NULL,
master VARCHAR(128) DEFAULT NULL,
last_check INT DEFAULT NULL,
type VARCHAR(6) NOT NULL,
notified_serial INT DEFAULT NULL,
account VARCHAR(40) DEFAULT NULL,
primary key (id)
);

 CREATE UNIQUE INDEX name_index ON domains(name);

 CREATE TABLE records (
id INT auto_increment,
domain_id INT DEFAULT NULL,
name VARCHAR(255) DEFAULT NULL,
type VARCHAR(6) DEFAULT NULL,
content VARCHAR(255) DEFAULT NULL,
ttl INT DEFAULT NULL,
prio INT DEFAULT NULL,
change_date INT DEFAULT NULL,
primary key(id)
);

 CREATE INDEX rec_name_index ON records(name);
CREATE INDEX nametype_index ON records(name,type);
CREATE INDEX domain_id ON records(domain_id);

 CREATE TABLE supermasters (
ip VARCHAR(25) NOT NULL,
nameserver VARCHAR(255) NOT NULL,
account VARCHAR(40) DEFAULT NULL
);
hdknr@mailjail:/home/www/sites/jail.hdknr.deb/poweradmin-2.1.3/sql$ cat
mysql.sql | mysql -u powerdns --password=powerdns powerdns

Filed under  //   poweradmin   powerdns  

Comments [0]

powerdns: poweradmin install on Squeeze.

hdknr@mailjail:~$ wget https://www.poweradmin.org/download/poweradmin-2.1.3.tgz
--2009-08-16 08:44:52--  https://www.poweradmin.org/download/poweradmin-2.1.3.tgz
www.poweradmin.org をDNSに問いあわせています... 94.142.245.87
www.poweradmin.org|94.142.245.87|:443 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 93541 (91K) [application/x-tar]
`poweradmin-2.1.3.tgz' に保存中

100%[===========================================================================================>] 93,541      74.2K/s 時間 1.2s    

2009-08-16 08:44:55 (74.2 KB/s) - `poweradmin-2.1.3.tgz' へ保存完了 [93541/93541]

hdknr@mailjail:~$ tar xfz poweradmin-2.1.3.tgz
hdknr@mailjail:~$ cd poweradmin-2.1.3/
hdknr@mailjail:~/poweradmin-2.1.3$ cd docs/
hdknr@mailjail:~/poweradmin-2.1.3/docs$

hdknr@mailjail:~/poweradmin-2.1.3$ find . -name "config*"  -print
./inc/config-me.inc.php

hdknr@mailjail:/home/www/sites/jail.hdknr.deb/poweradmin-2.1.3/inc$ cat ../docs/poweradmin-mysql-db-structure.sql | mysql -u powerdns --password=powerdns powerdns

DBエラー。PEARかな。
Error: You have to create a config.inc.php!

Warning: require_once(MDB2.php) [function.require-once]: failed to open stream: No such file or directory in /home/www/sites/jail.hdknr.deb/poweradmin-2.1.3/inc/database.inc.php on line 22

Fatal error: require_once() [function.require]: Failed opening required 'MDB2.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/www/sites/jail.hdknr.deb/poweradmin-2.1.3/inc/database.inc.php on line 22

hdknr@mailjail:/home/www/sites/jail.hdknr.deb/poweradmin-2.1.3/inc$ sudo aptitude install php-mdb2-driver-mysql
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています               
状態情報を読み取っています... 完了
拡張状態情報を読み込んでいます     
パッケージの状態を初期化しています... 完了
タスクの記述を読み込んでいます... 完了       
以下の新規パッケージがインストールされます:
  php-mdb2{a} php-mdb2-driver-mysql
更新: 0 個、新規インストール: 2 個、削除: 0 個、保留: 0 個。
122kB のアーカイブを取得する必要があります。展開後に 836kB のディスク領域が新たに消費されます。
先に進みますか? [Y/n/?] y
拡張状態情報を書き込んでいます... 完了
取得:1 http://ftp.jp.debian.org squeeze/main php-mdb2 2.5.0b2-1 [81.7kB]
取得:2 http://ftp.jp.debian.org squeeze/main php-mdb2-driver-mysql 1.5.0b2-1 [40.6kB]
122kB を 0s 秒でダウンロードしました (287kB/s)
未選択パッケージ php-mdb2 を選択しています。
(データベースを読み込んでいます ... 現在 46200 個のファイルとディレクトリがインストールされています。)
(.../php-mdb2_2.5.0b2-1_all.deb から) php-mdb2 を展開しています...
未選択パッケージ php-mdb2-driver-mysql を選択しています。
(.../php-mdb2-driver-mysql_1.5.0b2-1_all.deb から) php-mdb2-driver-mysql を展開しています...
php-mdb2 (2.5.0b2-1) を設定しています ...
php-mdb2-driver-mysql (1.5.0b2-1) を設定しています ...
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています               
状態情報を読み取っています... 完了
拡張状態情報を読み込んでいます     
パッケージの状態を初期化しています... 完了
拡張状態情報を書き込んでいます... 完了       
タスクの記述を読み込んでいます... 完了 

エラー。
Error: You have to create a config.inc.php!

Warning: include_once(inc/config.inc.php) [function.include-once]: failed to open stream: No such file or directory in /home/www/sites/jail.hdknr.deb/poweradmin-2.1.3/inc/i18n.inc.php on line 22

Warning: include_once() [function.include]: Failed opening 'inc/config.inc.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /home/www/sites/jail.hdknr.deb/poweradmin-2.1.3/inc/i18n.inc.php on line 22

ファイル名が、config-inc.phpだった。
hdknr@mailjail:/home/www/sites/jail.hdknr.deb/poweradmin-2.1.3/inc$ sudo mv config-inc.php config.inc.php


Error: The install/ directory exists, you must remove it first before proceeding.

なので、mv install .installしたらログイン画面。

admin/admin でログインします。
hdknr@mailjail:/home/www/sites/jail.hdknr.deb/poweradmin-2.1.3/docs$ grep admin poweradmin-mysql-db-structure.sql
INSERT INTO `users` VALUES (1,'admin','21232f297a57a5a743894a0e4a801fc3','Administrator','admin@example.net','Administrator with full rights.',1,1);

Filed under  //   poweradmin   powerdns  

Comments [0]

Documentation/ConfigurationFile – Poweradmin

Configuration file

Usage

With any new installation the file "inc/config-me.inc.php" is distributed. You should not edit this file. If you do, it is very likely your changes will be overwritten with an upgrade. Instead, create the file "inc/config.inc.php" and set the variables you want to set there. Your changes will overwrite the defaults provided by us. This way, we are able to add new configuration options, including a good working default, without immediatelly breaking your configuration or requiring manual intervention.

Variables

The following configuration variables are available:

db_host no default The host to connect to for access to the database.
db_user no default The username to use to access the database.
db_pass no default The password to use to access the database.
db_name no default The name of the database of PowerDNS.
db_type no default The type of the database of PowerDNS. Poweradmin currently has support for 'mysql' and 'pgsql'.
iface_lang en_EN The language for the interface. Currently "en_EN" and "nl_NL" are supported.
iface_style example The CSS template to use as skin of web interface. See "style/" directory.
iface_rowamount 50 The maximum number of rows that should be shown (usefull if you have a large number of zones or records).
iface_expire 1800 Session time-out in seconds. After this timeout, you are automagically logged out.
iface_zonelist_serial 0 Enable (1) or disable (0) display of zone's serial in the zone listing.
dns_hostmaster no default The default emailaddress to use for the RP in the SOA record. For example: "hostmaster.example.net".
dns_ns1 no default The default primary nameserver.
dns_ns2 no default The default secondary nameserver.
dns_ttl 86400 The default TTL for records (in seconds of course).
dns_fancy false Enable fancy records (true) or not (false).
dns_icann_tld 1 If enabled, allow official TLD's only. Possible values: "0" or "1".

Filed under  //   poweradmin   powerdns  

Comments [0]

Documentation/Install – Poweradmin

Installation steps (manually)

Doing a manual installation is not recommended.

  • Before actually installing Poweradmin, create a backup of your current PowerDNS database. Better safe than sorry.
  • After you have downloaded the Poweradmin package from the website, unpack it in the web directory you want it run it from.
  • Add a SQL user for the PowerDNS database that is granted SELECT, INSERT, DELETE, UPDATE and CREATE actions.
  • Import the Poweradmin database structure into the PowerDNS database. The database structure is available in the docs/ directory.
  • Create a configuration. Copy "inc/config-me.inc/php" to "inc/config.inc.php" and provide all required values.
  • Remove the "install/" directory from the Poweradmin direcory.
  • Point your browser to the web interface. You should be able to login using the username "admin" and password "admin".
  • First thing to do is to change the password of the user "admin".

DBを作って、config.inc.phpを設定する。(config-me.inc.phpからコピる)

Filed under  //   poweradmin   powerdns  

Comments [0]

Poweradmin

Welcome to Poweradmin!

A friendly web interface for PowerDNS

Poweradmin is a friendly web-based DNS administration tool for Bert Hubert's PowerDNS server. The interface has full support for most of the features of PowerDNS. It has full support for all zone types (master, native and slave), for supermasters for automatic provisioning of slave zones, full support for IPv6 and comes with multi-language support. See feature list for all features.

This version of Poweradmin is an adapation of the Poweradmin that was written by Jorn Ekkelenkamp and Roeland Nieuwenhuis a few years ago. The current version has been extended with numerous features that were missing in the original code and has considerable performance improvements. We also removed the "sequence updater" and replaced the database abstract layer code. We are now working hard in getting the basic setup right. As soon as all functionality is fixed, we will start working on the interface itself, improving it's useability and make it more attractive.

Poweradmin is released under a GPL license. Most recent stable version is 2.1.3.

News

Further reading

Filed under  //   poweradmin   powerdns  

Comments [0]

powerdns: Squeeze にapt した直後。

hdknr@mailjail:~$ sudo ps ax | grep dns
sudo: unable to resolve host mailjail
 1754 ?        Ss     0:00 /usr/sbin/pdns_recursor
 2360 pts/1    S<+    0:00 grep dns

hdknr@mailjail:~$ sudo lsof -c pdns_recursor
sudo: unable to resolve host mailjail
COMMAND    PID USER   FD   TYPE     DEVICE SIZE/OFF  NODE NAME
pdns_recu 1754 pdns  cwd    DIR        3,1     4096     2 /
pdns_recu 1754 pdns  rtd    DIR        3,1     4096     2 /
pdns_recu 1754 pdns  txt    REG        3,1   891980 73653 /usr/sbin/pdns_recursor
pdns_recu 1754 pdns  mem    REG        3,1    42564 25195 /lib/i686/cmov/libnss_files-2.9.so
pdns_recu 1754 pdns  mem    REG        3,1    38504 25201 /lib/i686/cmov/libnss_nis-2.9.so
pdns_recu 1754 pdns  mem    REG        3,1    87864 25197 /lib/i686/cmov/libnsl-2.9.so
pdns_recu 1754 pdns  mem    REG        3,1    30496 25191 /lib/i686/cmov/libnss_compat-2.9.so
pdns_recu 1754 pdns  mem    REG        3,1  1425856 25184 /lib/i686/cmov/libc-2.9.so
pdns_recu 1754 pdns  mem    REG        3,1   171216 16356 /lib/libgcc_s.so.1
pdns_recu 1754 pdns  mem    REG        3,1   149388 25189 /lib/i686/cmov/libm-2.9.so
pdns_recu 1754 pdns  mem    REG        3,1   954532 98117 /usr/lib/libstdc++.so.6.0.12
pdns_recu 1754 pdns  mem    REG        3,1   117408 18648 /lib/ld-2.9.so
pdns_recu 1754 pdns    0u   CHR        1,3      0t0   757 /dev/null
pdns_recu 1754 pdns    1u   CHR        1,3      0t0   757 /dev/null
pdns_recu 1754 pdns    2u   CHR        1,3      0t0   757 /dev/null
pdns_recu 1754 pdns    3u  unix 0xcf840240      0t0  5923 socket
pdns_recu 1754 pdns    4u  IPv4       4508      0t0   UDP localhost:domain
pdns_recu 1754 pdns    5u  IPv4       4509      0t0   TCP localhost:domain (LISTEN)
pdns_recu 1754 pdns    6u  unix 0xcf840040      0t0  4511 /var/run//pdns_recursor.controlsocket
pdns_recu 1754 pdns    7u  0000        0,7        0    56 anon_inode


/etc/powerdns/pdns.conf

mailjail:/etc/powerdns# grep -v "#" pdns.conf  | grep -v "^$"
allow-recursion=127.0.0.1
config-dir=/etc/powerdns
daemon=yes
disable-axfr=yes
guardian=yes
lazy-recursion=yes
local-address=0.0.0.0
local-port=53
module-dir=/usr/lib/powerdns
setgid=pdns
setuid=pdns
socket-dir=/var/run
version-string=powerdns
include=/etc/powerdns/pdns.d

/etc/powerdns/pdns.d/pdns.local

mailjail:/etc/powerdns/pdns.d# more pdns.local
# Here come the local changes the user made, like configuration of
# the several backends that exist.

/etc/init.d/pdns-recursor

mailjail:/etc/powerdns/pdns.d# more /etc/init.d/pdns-recursor
#!/bin/sh
### BEGIN INIT INFO
# Provides:          pdns-recursor
# Required-Start:    networking
# Required-Stop:     networking
# Default-Start:     2 3 4 5
# Default-Stop:      0 6
# Short-Description: Start the recursor at boot time.
### END INIT INFO

#
# Authors:    Matthijs Mohlmann <matthijs@cacholong.nl>
#           Christoph Haas <haas@debian.org>
#
# Thanks to:
# Thomas Hood <jdthood@aglu.demon.nl>
#
# initscript for PowerDNS recursor

set -e

. /lib/lsb/init-functions

PATH=/sbin:/bin:/usr/sbin:/usr/bin
DESC="PowerDNS recursor"
NAME=pdns_recursor
DAEMON=/usr/sbin/$NAME
# Derive the socket-dir setting from /etc/powerdns/recursor.conf
# or fall back to the default /var/run if not specified there.
PIDDIR=$(awk -F= '/^socket-dir=/ {print $2}' /etc/powerdns/recursor.conf)
if [ -z "$PIDDIR" ]; then PIDDIR=/var/run; fi
PIDFILE=$PIDDIR/$NAME.pid

# Gracefully exit if the package has been removed.
test -x $DAEMON || exit 0

# Read config file if it is present.
if [ -r /etc/default/pdns-recursor ]; then
  . /etc/default/pdns-recursor
fi

start() {
# Return
#  0 if daemon has been started / was already running
#  >0 if daemon could not be started
  start-stop-daemon --start --oknodo --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null || return 0
  start-stop-daemon --start --oknodo --quiet --pidfile $PIDFILE --exec $DAEMON || return 2
}

start_resolvconf() {
  if [ -x /sbin/resolvconf ]; then
    echo "nameserver 127.0.0.1" | /sbin/resolvconf -a lo.pdns-recursor
  fi
  return 0
}

stop() {
# Return
#  0 if daemon has been stopped
#  1 if daemon was already stopped
#  2 if daemon could not be stopped
#  other if a failure occured
  set +e
  start-stop-daemon --stop --quiet --retry=HUP/30/TERM/5/KILL/5 --pidfile $PIDFILE --name $NAME
  RETVAL="$?"
  [ "$RETVAL" = 2 ] && return 2
  rm -f $PIDFILE
  return "$RETVAL"
}

stop_resolvconf() {
  if [ -x /sbin/resolvconf ]; then
    /sbin/resolvconf -d lo.pdns-recursor
  fi
  return 0
}

case "$1" in
  start)
    if [ "$START" != "yes" ]; then
      log_begin_msg "Not starting $DESC -- disabled."
      log_end_msg 0
      exit 0
    fi
    log_daemon_msg "Starting $DESC" "pdns-recursor"
    start
    case "$?" in
      0)
        start_resolvconf
        break
        ;;
      1)
        log_progress_msg "(already running)"
        break
        ;;
      *)
        log_progress_msg " (failed)."
        log_end_msg 1
        exit 1
        ;;
    esac
    log_end_msg 0
  ;;
  stop)
    stop_resolvconf
    log_daemon_msg "Stopping $DESC" "pdns-recursor"
    stop
    case "$?" in
      0)
        break
        ;;
      1)
        log_progress_msg "(not running)"
        break
        ;;
      *)
        log_progress_msg "(failed)"
        log_end_msg 1
        exit 1
        ;;
    esac
    log_end_msg 0
  ;;
  restart|force-reload)
    if [ "$START" != "yes" ]; then
      $0 stop
      exit 0
    fi
    log_daemon_msg "Restarting $DESC" "pdns-recursor"
    stop
    case "$?" in
      0|1)
        start
        case "$?" in
          0)
            log_end_msg 0
            exit 0
            ;;
          1)
            log_progress_msg "(failed -- old process still running)"
            log_end_msg 1
            exit 1
            ;;
          *)
            log_progress_msg "(failed to start)"
            log_end_msg 1
            exit 1
            ;;
        esac
      ;;
      *)
        log_progress_msg "(failed to stop)"
        log_end_msg 1
        exit 1
      ;;
    esac
  ;;
  force-stop)
    killall -v -9 pdns_recursor
    echo "killed"
    ;;

  *)
    echo "Usage: $0 {start|stop|restart|force-reload|force-stop}" >&2
    exit 3
  ;;
esac

exit 0

/etc/default/pdns-recursor

mailjail:/etc/powerdns/pdns.d# cat /etc/default/pdns-recursor
# Variables for PowerDNS recursor
#
# Set START to yes to start the pdns-recursor
START=yes

/etc/init.d/pdns

mailjail:/etc/powerdns/pdns.d# cat  /etc/init.d/pdns
#!/bin/sh
### BEGIN INIT INFO
# Provides:          pdns
# Required-Start:    networking
# Required-Stop:     networking
# Default-Start:     2 3 4 5
# Default-Stop:      0 6
# Short-Description: PDNS is a versatile high performance authoritative nameserver.
### END INIT INFO

PATH=/bin:/sbin:/usr/bin:/usr/sbin
BINARYPATH=/usr/bin
SBINARYPATH=/usr/sbin
SOCKETPATH=/var/run
NAME=pdns-server

[ -f "$SBINARYPATH/pdns_server" ] || exit 0

if [ -r /etc/default/pdns ]; then
  . /etc/default/pdns
fi

cd $SOCKETPATH
suffix=`basename $0 | awk -F- '{print $2}'`
if [ $suffix ]; then
    EXTRAOPTS=--config-name=$suffix
    PROGNAME=pdns-$suffix
else
    PROGNAME=pdns
fi

pdns_server="$SBINARYPATH/pdns_server $EXTRAOPTS"

doPC()
{
    ret=$($BINARYPATH/pdns_control $EXTRAOPTS $1 $2 2> /dev/null)
}

doPC ping
NOTRUNNING=$?

case "$1" in
    status)
        if test "$NOTRUNNING" = "0"; then
            doPC status
            echo $ret
        else
            echo "not running"
        fi
    ;;
    stop)
        echo -n "Stopping PowerDNS authoritative nameserver: "
        if test "$NOTRUNNING" = "0"; then
            doPC quit
            echo $ret
        else
            echo "not running"
        fi
    ;;
    force-stop)
        echo -n "Stopping PowerDNS authoritative nameserver: "
        killall -v -9 pdns_server
        echo "killed"
    ;;
    start)
        echo -n "Starting PowerDNS authoritative nameserver: "
        if [ "$NOTRUNNING" = "0" ] || [ "$START" = "no" ]; then
            echo "already running or disabled"
        else
            $pdns_server --daemon --guardian=yes
            if test "$?" = "0"; then
                echo "started"
            fi
        fi
    ;;
    force-reload | restart)
        echo -n "Restarting PowerDNS authoritative nameserver: "
        echo -n stopping and waiting..
        doPC quit
        sleep 3
        echo done
        $0 start
    ;;
    reload)
        echo -n "Reloading PowerDNS authoritative nameserver: "
        if test "$NOTRUNNING" = "0"; then
            doPC cycle
            echo requested reload
        else
            echo not running yet
            $0 start
        fi
    ;;
    monitor)
        if test "$NOTRUNNING" = "0"; then
            echo "already running"
        else
            $pdns_server --daemon=no --guardian=no --control-console --loglevel=9
        fi
    ;;       
    dump)
        if test "$NOTRUNNING" = "0"; then
            doPC list
            echo $ret
        else
            echo "not running"
        fi
    ;;       
    show)
        if [ $# -lt 2 ]; then
            echo Insufficient parameters
            exit
        fi
        if test "$NOTRUNNING" = "0"; then
            echo -n "$2="
            doPC show $2 ; echo $ret
        else
            echo "not running"
        fi
    ;;
    mrtg)
        if [ $# -lt 2 ]; then
            echo Insufficient parameters
            exit
        fi
        if test "$NOTRUNNING" = "0"; then
            doPC show $2 ; echo $ret
            if [ "$3x" != "x" ]; then
                doPC show $3 ; echo $ret
            else
                echo 0
            fi
            doPC uptime ; echo $ret
            echo PowerDNS daemon
        else
            echo "not running"
        fi
    ;;
    cricket)
        if [ $# -lt 2 ]; then
            echo Insufficient parameters
            exit
        fi
        if test "$NOTRUNNING" = "0"; then
            doPC show $2 ; echo $ret
        else
            echo "not running"
        fi
    ;;       

    *)
        echo pdns [start\|stop\|force-reload\|restart\|status\|dump\|show\|mrtg\|cricket\|monitor]
    ;;
esac

exit 0

/etc/default/pdns

mailjail:/etc/powerdns/pdns.d# more /etc/default/pdns
# Variables for PowerDNS
#
# Whether you want to start PowerDNS automatically.
START=yes

# If you have resolvconf installed, you can enable the following to have
# resolvconf update an recursor line in the pdns config, as determined by
# resolvconf.
RESOLVCONF_UPDATE_FORWARDERS=no

Filed under  //   powerdns  

Comments [0]

powerdns : Debian Squeeze Install

hdknr@mailman:~$ apt-cache search powerdns
collectd - statistics collection and monitoring daemon
libnet-dns-fingerprint-perl - library to determine DNS server vendor,
product and version
pdns-backend-geo - geo backend for PowerDNS
pdns-backend-ldap - LDAP backend for PowerDNS
pdns-backend-mysql - generic MySQL backend for PowerDNS
pdns-backend-pgsql - generic PostgreSQL backend for PowerDNS
pdns-backend-pipe - pipe/coprocess backend for PowerDNS
pdns-backend-sqlite - sqlite backend for PowerDNS
pdns-backend-sqlite3 - sqlite backend for PowerDNS
pdns-doc - PowerDNS manual
pdns-recursor - PowerDNS recursor
pdns-server - extremely powerful and versatile nameserver

 hdknr@mailman:~$ sudo aptitude install pdns-server pdns-recursor
pdsn-doc pdns-backend-mysql
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
拡張状態情報を読み込んでいます
パッケージの状態を初期化しています... 完了
タスクの記述を読み込んでいます... 完了
名前か説明が "pdsn-doc" にマッチするパッケージは見つかりませんでした
名前か説明が "pdsn-doc" にマッチするパッケージは見つかりませんでした
以下の新規パッケージがインストールされます:
pdns-backend-mysql pdns-doc{a} pdns-recursor pdns-server
更新: 0 個、新規インストール: 4 個、削除: 0 個、保留: 0 個。
1462kB のアーカイブを取得する必要があります。展開後に 4157kB のディスク
領域が新たに消費されます。
先に進みますか? [Y/n/?] ^C
hdknr@mailman:~$ sudo aptitude install pdns-server pdns-recursor
pdns-doc pdns-backend-mysql
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
拡張状態情報を読み込んでいます
パッケージの状態を初期化しています... 完了
タスクの記述を読み込んでいます... 完了
以下の新規パッケージがインストールされます:
pdns-backend-mysql pdns-doc pdns-recursor pdns-server
更新: 0 個、新規インストール: 4 個、削除: 0 個、保留: 0 個。
1462kB のアーカイブを取得する必要があります。展開後に 4157kB のディスク
領域が新たに消費されます。
拡張状態情報を書き込んでいます... 完了
取得:1 http://ftp.jp.debian.org squeeze/main pdns-server 2.9.22-1 [770kB]
取得:2 http://ftp.jp.debian.org squeeze/main pdns-backend-mysql 2.9.22-1
[60.9kB]
取得:3 http://ftp.jp.debian.org squeeze/main pdns-doc 2.9.22-1 [199kB]
取得:4 http://ftp.jp.debian.org squeeze/main pdns-recursor 3.1.7-5 [432kB]
1462kB を 0s 秒でダウンロードしました (1486kB/s)
パッケージを事前設定しています ...
未選択パッケージ pdns-server を選択しています。
(データベースを読み込んでいます ... 現在 43250 個のファイルとディレクト
リがインストールされています。)
(.../pdns-server_2.9.22-1_i386.deb から) pdns-server を展開しています...
未選択パッケージ pdns-backend-mysql を選択しています。
(.../pdns-backend-mysql_2.9.22-1_i386.deb から) pdns-backend-mysql を展
開しています...
未選択パッケージ pdns-doc を選択しています。
(.../pdns-doc_2.9.22-1_all.deb から) pdns-doc を展開しています...
未選択パッケージ pdns-recursor を選択しています。
(.../pdns-recursor_3.1.7-5_i386.deb から) pdns-recursor を展開しています...
man-db のトリガを処理しています ...
pdns-server (2.9.22-1) を設定しています ...
Creating user and group pdns...done

 Creating config file /etc/powerdns/pdns.conf with new version

 Creating config file /etc/default/pdns with new version

 Creating config file /etc/powerdns/pdns.d/pdns.local with new version
Restarting PowerDNS authoritative nameserver: stopping and waiting..done
Starting PowerDNS authoritative nameserver: started
pdns-backend-mysql (2.9.22-1) を設定しています ...
Restarting PowerDNS authoritative nameserver: stopping and waiting..done
Starting PowerDNS authoritative nameserver: started
pdns-doc (2.9.22-1) を設定しています ...
pdns-recursor (3.1.7-5) を設定しています ...
Starting PowerDNS recursor: pdns-recursorAug 16 04:39:02 PowerDNS
recursor 3.1.7 (C) 2001-2008 PowerDNS.COM BV (May 13 2009, 21:41:18, gcc
4.3.3) starting up
Aug 16 04:39:02 PowerDNS comes with ABSOLUTELY NO WARRANTY. This is free
software, and you are welcome to redistribute it according to the terms
of the GPL version 2.
Aug 16 04:39:02 Operating in 32 bits mode
Aug 16 04:39:02 Reading random entropy from '/dev/urandom'
Aug 16 04:39:02 Only allowing queries from: 127.0.0.0/8, 10.0.0.0/8,
192.168.0.0/16, 172.16.0.0/12, ::1/128, fe80::/10
Aug 16 04:39:02 Inserting rfc 1918 private space zones
Aug 16 04:39:02 Listening for UDP queries on 127.0.0.1:53
Aug 16 04:39:02 Listening for TCP queries on 127.0.0.1:53
Aug 16 04:39:02 Done priming cache with root hints
Aug 16 04:39:02 Calling daemonize, going to background
.
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
拡張状態情報を読み込んでいます
パッケージの状態を初期化しています... 完了
拡張状態情報を書き込んでいます... 完了
タスクの記述を読み込んでいます... 完了

Filed under  //   Debian   powerdns   Squeeze  

Comments [0]