pdnsd modify record

PDNS modify record for some domain record

I have one domain. I want change the domain a record for DNS service

Ourself Env: ubuntu 12.04

install pdnsd

command
1
apt-get install pdnsd

###edit configure file for pdnsd

  • modify init configure for pdnsd /etc/init.d/pdnsd
/etc/init.d/pdnsd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh
### BEGIN INIT INFO
# Provides: pdnsd
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start pdnsd
# Description: Provides a Proxy DNS Server.
### END INIT INFO
NAME="pdnsd"
DESC="proxy DNS server"
DAEMON="/usr/sbin/pdnsd"
PIDFILE="/var/run/pdnsd.pid"
CACHE="/var/cache/pdnsd/pdnsd.cache"
test -x $DAEMON || exit 0
if test -f "/etc/default/$NAME"
then
. /etc/default/$NAME
fi
START_OPTIONS="${START_OPTIONS} -c /etc/pdnsd.conf"
. /lib/lsb/init-functions
is_yes() {
case "$1" in
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|1) return 0;;
*) return 1;
esac
}
log_end_msg2 () {
log_end_msg "$@"
test $1 -eq 0 || exit 1
}
gen_cache()
{
if ! test -f "$CACHE"; then
mkdir -p `dirname $CACHE`
dd if=/dev/zero of="$CACHE" bs=1 count=4 2> /dev/null
chown -R pdnsd.proxy /var/cache/pdnsd
fi
}
check_pid()
{
if test -f "$PIDFILE"; then
log_warning_msg "pid file is exist in $PIDFILE, stop $pdnsd it or restart $pdnsd"
exit 0
fi
}
...
  • modfiy /etc/pdnsd.conf
/etc/pdnsd.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
global {
perm_cache = 2048;
cache_dir = "/var/cache/pdnsd";
run_as = "pdnsd";
server_ip = 127.0.0.1; // Use eth0 here if you want to allow other
// machines on your network to query pdnsd.
query_method=tcp_only;
server_port=5353;
status_ctl = on;
paranoid = on;
min_ttl = 1m; // Retain cached entries at least 15 minutes.
max_ttl = 2m; // One week.
timeout = 10; // Global timeout option (10 seconds).
}
server {
label = "dns";
ip= 8.8.8.8 # for example
timeout=4;
root_server = on;
interval=10m;
uptest = none;
}
rr {
name = need.forward.domain.;
cname = www.facebook.com
reverse=on;
}

restart pdnsd service

command
1
/etc/init.d/pdnsd restart

debug command

command
1
pdnsd-ctl dump

make sure the domain has right record