~ubuntu-branches/ubuntu/wily/maradns/wily-proposed

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

# This is a basic Deadwood test to make sure it works

killall maradns > /dev/null 2>&1 # Don't run this test on Solaris
sleep 2

cat > mararc << EOF
chroot_dir="$( pwd )"
ipv4_bind_addresses="127.0.0.2"
csv2 = {}
csv2["example.com."] = "db.example.com"
EOF

cat > db.example.com << EOF
*.% A 10.1.2.3
EOF

# OK, test the server
../../../server/maradns -f mararc > /dev/null 2>&1 &
#../../../server/maradns -f mararc &
sleep 1

# Now, make sure Deadwood works

for PORT in 53 5300 ; do

cat > dwood2rc << EOF
chroot_dir="$( pwd )"
ipv4_bind_addresses="127.0.0.1"
upstream_servers = {}
upstream_servers["."]="127.0.0.2"
recursive_acl="127.0.0.1/16"
dns_port=${PORT}
filter_rfc1918 = 0
EOF

../../src/Deadwood -f dwood2rc > /dev/null &
#../../src/Deadwood -f dwood2rc &
sleep 1
dig @127.0.0.1 -p ${PORT} www1.example.com. | \
	grep -v 'global options' | perl -pe 's/>>.*<<//;
s/id:.*//;
s/time:.*//;
s/WHEN:.*//;' | awk '/example.com/ {gsub(/86[0-9][0-9][0-9]/,"")} {print}'

sleep 1
killall Deadwood
sleep 1

done

# Clean up
killall maradns
rm mararc
rm db.example.com
rm dwood2rc