systems.
+24 November 2023: Yorgos
+ - Use 127.0.0.1 explicitly in tests to avoid delays and errors on
+ newer systems.
+
9 November 2023: Wouter
- Fix unit test parse of origin syntax.
PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
if grep SERVFAIL outfile; then
echo "> try again"
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 10
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 10
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
echo "> cat logfiles"
cat fwd.log
. ../common.sh
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
if grep SERVFAIL outfile; then
echo "> try again"
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 10
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 10
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
echo "> cat logfiles"
cat petal.log
# do the test
TARGET=ns1.blanks.example.com.
echo "> dig $TARGET"
-dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
if grep SERVFAIL outfile; then
echo "> try again"
- dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 10
- dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 10
- dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
fi
echo "> cat logfiles"
cat unbound.log
# do the test
TARGET=ns1.blanks.example.com.
echo "> dig $TARGET"
-dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
if grep SERVFAIL outfile; then
echo "> try again"
- dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 10
- dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 10
- dig @localhost -p $UNBOUND_PORT $TARGET | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT $TARGET | tee outfile
fi
echo "> cat logfiles"
cat petal.log
# query for a text record that is stored by unbound's cache and cachedb
# in the testframe cache.
echo "> dig txt1.example.com."
-dig @localhost -p $UNBOUND_PORT txt1.example.com. TXT | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT txt1.example.com. TXT | tee outfile
if grep "example text message" outfile; then
echo "OK"
else
wait_ldns_testns_up fwd2.log
echo "> dig txt1.example.com. from unbound cache"
-dig @localhost -p $UNBOUND_PORT txt1.example.com. TXT | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT txt1.example.com. TXT | tee outfile
if grep "example text message" outfile; then
echo "OK"
else
fi
echo "> dig txt1.example.com. from cachedb"
-dig @localhost -p $UNBOUND_PORT txt1.example.com. TXT | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT txt1.example.com. TXT | tee outfile
if grep "example text message" outfile; then
echo "OK"
else
echo ""
echo "> dig txt1.example.com."
-dig @localhost -p $UNBOUND_PORT txt1.example.com. TXT | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT txt1.example.com. TXT | tee outfile
if grep "example text message" outfile; then
echo "OK"
else
wait_ldns_testns_up fwd4.log
echo "> dig txt1.example.com. from unbound cache"
-dig @localhost -p $UNBOUND_PORT txt1.example.com. TXT | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT txt1.example.com. TXT | tee outfile
if grep "example text message" outfile; then
echo "OK"
else
fi
echo "> dig txt1.example.com. from cachedb, but that has no message stored"
-dig @localhost -p $UNBOUND_PORT txt1.example.com. TXT | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT txt1.example.com. TXT | tee outfile
if grep "SERVFAIL" outfile; then
echo "OK"
else
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT wwwabcdefghijklmnopqrstuvwxyzwww.example.com | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT wwwabcdefghijklmnopqrstuvwxyzwww.example.com | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT wwwabcdefghijklmnopqrstuvwxyzwww.example.com | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT wwwabcdefghijklmnopqrstuvwxyzwww.example.com | tee outfile
echo "> cat logfiles"
cat fwd.log
cat fwd2.log
PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT wwwabcdefghijklmnopqrstuvwxyzwww.example.com | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT wwwabcdefghijklmnopqrstuvwxyzwww.example.com | tee outfile
echo "> cat logfiles"
cat fwd.log
cat fwd2.log
# First the nasty name.
# The server should not have performed EDNS fallback and cached it.
echo "> dig nasty.example.com."
-dig @localhost -p $UNBOUND_PORT nasty.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT nasty.example.com. | tee outfile
# no answer possible for it.
echo "> check backed-off"
# Then the www name.
# See if we can still get the EDNS data.
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
# First the nasty name.
# The server should not have performed EDNS fallback and cached it.
echo "> dig nasty.example.com."
-dig @localhost -p $UNBOUND_PORT nasty.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT nasty.example.com. | tee outfile
# no answer possible for it.
echo "> check no-answer"
# Then the www name.
# See if we can still get the EDNS data.
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
# so that all three queries get timeouts during the later test.
#
#echo "> dig www1.example.com."
-#dig @localhost -p $UNBOUND_PORT www1.example.com. | tee outfile
+#dig @127.0.0.1 -p $UNBOUND_PORT www1.example.com. | tee outfile
#echo "> cat logfiles"
#cat fwd.log
#cat unbound.log
#fi
echo "> do queries"
-dig @localhost -p $UNBOUND_PORT www1.example.com. >outfile1 &
+dig @127.0.0.1 -p $UNBOUND_PORT www1.example.com. >outfile1 &
digpid1=$!
-dig @localhost -p $UNBOUND_PORT www2.example.com. >outfile2 &
+dig @127.0.0.1 -p $UNBOUND_PORT www2.example.com. >outfile2 &
digpid2=$!
-dig @localhost -p $UNBOUND_PORT www3.example.com. >outfile3 &
+dig @127.0.0.1 -p $UNBOUND_PORT www3.example.com. >outfile3 &
digpid3=$!
-dig @localhost -p $UNBOUND_PORT www4.example.com. >outfile4 &
+dig @127.0.0.1 -p $UNBOUND_PORT www4.example.com. >outfile4 &
digpid4=$!
-dig @localhost -p $UNBOUND_PORT www5.example.com. >outfile5 &
+dig @127.0.0.1 -p $UNBOUND_PORT www5.example.com. >outfile5 &
digpid5=$!
-dig @localhost -p $UNBOUND_PORT www6.example.com. >outfile6 &
+dig @127.0.0.1 -p $UNBOUND_PORT www6.example.com. >outfile6 &
digpid6=$!
sleep 12
kill -9 $digpid1
PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost +vc -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 +vc -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
PRE="../.."
# do the test
echo "> dig www1.example.com."
-dig @localhost -p $UNBOUND_PORT www1.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www1.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
fi
echo "> do three queries"
-dig @localhost -p $UNBOUND_PORT +retry=10 +time=1 www1.example.com. >outfile1 &
+dig @127.0.0.1 -p $UNBOUND_PORT +retry=10 +time=1 www1.example.com. >outfile1 &
digpid1=$!
-dig @localhost -p $UNBOUND_PORT +retry=10 +time=1 www2.example.com. >outfile2 &
+dig @127.0.0.1 -p $UNBOUND_PORT +retry=10 +time=1 www2.example.com. >outfile2 &
digpid2=$!
-dig @localhost -p $UNBOUND_PORT +retry=10 +time=1 www3.example.com. >outfile3 &
+dig @127.0.0.1 -p $UNBOUND_PORT +retry=10 +time=1 www3.example.com. >outfile3 &
digpid3=$!
sleep 5
kill -9 $digpid1
PRE="../.."
# do the test
echo "> dig www1.example.com."
-dig @localhost -p $UNBOUND_PORT www1.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www1.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
fi
echo "> do three queries"
-dig @localhost -p $UNBOUND_PORT www1.example.com. >outfile1 &
+dig @127.0.0.1 -p $UNBOUND_PORT www1.example.com. >outfile1 &
digpid1=$!
-dig @localhost -p $UNBOUND_PORT www2.example.com. >outfile2 &
+dig @127.0.0.1 -p $UNBOUND_PORT www2.example.com. >outfile2 &
digpid2=$!
-dig @localhost -p $UNBOUND_PORT www3.example.com. >outfile3 &
+dig @127.0.0.1 -p $UNBOUND_PORT www3.example.com. >outfile3 &
digpid3=$!
sleep 5
kill -9 $digpid1
PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> check answer"
if grep "10.20.30.40" outfile; then
echo "OK"
# query again
rm outfile
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> check answer"
if grep "10.20.30.40" outfile; then
echo "OK"
PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
PRE="../.."
# do the test
echo "> dig tcp.example.com."
-dig @localhost -p $UNBOUND_PORT tcp.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT tcp.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
fi
echo "> dig udp.example.com."
-dig @localhost -p $UNBOUND_PORT udp.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT udp.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
# so that all three queries get timeouts during the later test.
#
#echo "> dig www1.example.com."
-#dig @localhost -p $UNBOUND_PORT www1.example.com. | tee outfile
+#dig @127.0.0.1 -p $UNBOUND_PORT www1.example.com. | tee outfile
#echo "> cat logfiles"
#cat fwd.log
#cat unbound.log
#fi
echo "> do queries"
-dig @localhost -p $UNBOUND_PORT www1.example.com. >outfile1 &
+dig @127.0.0.1 -p $UNBOUND_PORT www1.example.com. >outfile1 &
digpid1=$!
-dig @localhost -p $UNBOUND_PORT www2.example.com. >outfile2 &
+dig @127.0.0.1 -p $UNBOUND_PORT www2.example.com. >outfile2 &
digpid2=$!
-dig @localhost -p $UNBOUND_PORT www3.example.com. >outfile3 &
+dig @127.0.0.1 -p $UNBOUND_PORT www3.example.com. >outfile3 &
digpid3=$!
-dig @localhost -p $UNBOUND_PORT www4.example.com. >outfile4 &
+dig @127.0.0.1 -p $UNBOUND_PORT www4.example.com. >outfile4 &
digpid4=$!
-dig @localhost -p $UNBOUND_PORT www5.example.com. >outfile5 &
+dig @127.0.0.1 -p $UNBOUND_PORT www5.example.com. >outfile5 &
digpid5=$!
-dig @localhost -p $UNBOUND_PORT www6.example.com. >outfile6 &
+dig @127.0.0.1 -p $UNBOUND_PORT www6.example.com. >outfile6 &
digpid6=$!
sleep 15
# so that all three queries get timeouts during the later test.
#
#echo "> dig www1.example.com."
-#dig @localhost -p $UNBOUND_PORT www1.example.com. | tee outfile
+#dig @127.0.0.1 -p $UNBOUND_PORT www1.example.com. | tee outfile
#echo "> cat logfiles"
#cat fwd.log
#cat unbound.log
#fi
echo "> do three queries"
-dig @localhost -p $UNBOUND_PORT www1.example.com. >outfile1 &
+dig @127.0.0.1 -p $UNBOUND_PORT www1.example.com. >outfile1 &
digpid1=$!
-dig @localhost -p $UNBOUND_PORT www2.example.com. >outfile2 &
+dig @127.0.0.1 -p $UNBOUND_PORT www2.example.com. >outfile2 &
digpid2=$!
-dig @localhost -p $UNBOUND_PORT www3.example.com. >outfile3 &
+dig @127.0.0.1 -p $UNBOUND_PORT www3.example.com. >outfile3 &
digpid3=$!
sleep 15
kill -9 $digpid1
# now test that server is still up
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
# Query and check check that we get the correct answer from the auth_zone
query () {
echo "> dig www.example.com."
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
if grep SERVFAIL outfile; then
echo "> try again"
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 10
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 10
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
echo "> check answer"
if grep "1.2.3.4" outfile; then
# this one should have NXDOMAIN builtin
#
echo "> dig 1.0.31.172.in-addr.arpa."
-dig @localhost -p $UNBOUND_PORT 1.0.31.172.in-addr.arpa. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT 1.0.31.172.in-addr.arpa. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
# this one should give our own data as the reply
echo "> dig 1.0.30.172.in-addr.arpa."
-dig @localhost -p $UNBOUND_PORT 1.0.30.172.in-addr.arpa. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT 1.0.30.172.in-addr.arpa. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
# this one should give our own data as the reply
# but different trailing dot in unbound.conf file
echo "> dig 1.0.29.172.in-addr.arpa."
-dig @localhost -p $UNBOUND_PORT 1.0.29.172.in-addr.arpa. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT 1.0.29.172.in-addr.arpa. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
# foo.example.com is available through local-data (and recursion...).
#
echo "> dig www.example.com. +RD"
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
fi
echo "> dig www.example.com. +norec"
-dig @localhost +norec -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 +norec -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
fi
echo "> dig foo.example.com. +RD"
-dig @localhost -p $UNBOUND_PORT foo.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT foo.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
fi
echo "> dig foo.example.com. +norec"
-dig @localhost +norec -p $UNBOUND_PORT foo.example.com. | tee outfile
+dig @127.0.0.1 +norec -p $UNBOUND_PORT foo.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
# dig +norec for www does not work any more.
#
echo "> dig www.example.com. +RD"
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
fi
echo "> dig www.example.com. +norec"
-dig @localhost +norec -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 +norec -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
fi
echo "> dig foo.example.com. +RD"
-dig @localhost -p $UNBOUND_PORT foo.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT foo.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
fi
echo "> dig foo.example.com. +norec"
-dig @localhost +norec -p $UNBOUND_PORT foo.example.com. | tee outfile
+dig @127.0.0.1 +norec -p $UNBOUND_PORT foo.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
fi
echo "> dig www2.example.com."
-dig @localhost -p $UNBOUND_PORT www2.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www2.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
# do the test
# generate some load.
echo "> dig www[1-10].example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile1 &
-dig @localhost -p $UNBOUND_PORT www2.example.com. | tee outfile3 &
-dig @localhost -p $UNBOUND_PORT www3.example.com. | tee outfile2 &
-dig @localhost -p $UNBOUND_PORT www4.example.com. | tee outfile4 &
-dig @localhost -p $UNBOUND_PORT www5.example.com. | tee outfile5 &
-dig @localhost -p $UNBOUND_PORT www6.example.com. | tee outfile6 &
-dig @localhost -p $UNBOUND_PORT www7.example.com. | tee outfile7 &
-dig @localhost -p $UNBOUND_PORT www8.example.com. | tee outfile8 &
-dig @localhost -p $UNBOUND_PORT www9.example.com. | tee outfile9 &
-dig @localhost -p $UNBOUND_PORT www10.example.com. | tee outfile10 &
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile1 &
+dig @127.0.0.1 -p $UNBOUND_PORT www2.example.com. | tee outfile3 &
+dig @127.0.0.1 -p $UNBOUND_PORT www3.example.com. | tee outfile2 &
+dig @127.0.0.1 -p $UNBOUND_PORT www4.example.com. | tee outfile4 &
+dig @127.0.0.1 -p $UNBOUND_PORT www5.example.com. | tee outfile5 &
+dig @127.0.0.1 -p $UNBOUND_PORT www6.example.com. | tee outfile6 &
+dig @127.0.0.1 -p $UNBOUND_PORT www7.example.com. | tee outfile7 &
+dig @127.0.0.1 -p $UNBOUND_PORT www8.example.com. | tee outfile8 &
+dig @127.0.0.1 -p $UNBOUND_PORT www9.example.com. | tee outfile9 &
+dig @127.0.0.1 -p $UNBOUND_PORT www10.example.com. | tee outfile10 &
wait # wait for all jobs to complete.
PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT . SOA | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT . SOA | tee outfile
echo "> check answer"
if grep root-servers outfile | grep "nstld.verisign-grs.com"; then
echo "OK"
PRE="../.."
# test if unbound is up
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> check answer"
if grep "10.20.30.40" outfile; then
echo "OK"
PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
echo "> cat logfiles"
cat fwd.log
cat unbound.log
PRE="../.."
# do the test
echo "> dig www.example.com."
-dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
if grep SERVFAIL outfile; then
echo "> try again"
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 1
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 10
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
if grep SERVFAIL outfile; then
echo "> try again"
sleep 10
- dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
+ dig @127.0.0.1 -p $UNBOUND_PORT www.example.com. | tee outfile
fi
echo "> cat logfiles"
cat fwd.log