Difference between revisions of "OPS335 A2 Summer 2015 Tips"
(→How to test your secondary DNS ?) |
(→How to test your secondary DNS ?) |
||
Line 1: | Line 1: | ||
= How to test your secondary DNS ?= | = How to test your secondary DNS ?= | ||
<pre> | <pre> | ||
− | + | test_items="scs.senecac.on.ca www.senecac.on.ca matrix.senecac.on.ca zenit.senecac.on.ca" | |
− | + | pri_dns_ip=142.204.33.53 | |
− | + | sec_dns_ip=142.204.33.54 | |
− | PRI_ANS=$(nslookup -query=A $test_item $ | + | for test_item in $test_items |
+ | do | ||
+ | PRI_ANS=$(nslookup -query=A $test_item $pri_dns_ip | grep -v $pri_dns_ip | grep Address | awk '{print $2}') | ||
+ | |||
+ | #cho $PRI_ANS | ||
+ | |||
+ | SEC_ANS=$(nslookup -query=A $test_item $sec_dns_ip | grep -v $sec_dns_ip | grep Address | awk '{print $2}') | ||
+ | |||
+ | echo $PRI_ANS $SEC_ANS | ||
+ | |||
+ | [ "$SEC_ANS" = "$PRI_ANS" ] && echo match | ||
+ | done | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</pre> | </pre> |
Revision as of 10:14, 31 July 2015
How to test your secondary DNS ?
test_items="scs.senecac.on.ca www.senecac.on.ca matrix.senecac.on.ca zenit.senecac.on.ca" pri_dns_ip=142.204.33.53 sec_dns_ip=142.204.33.54 for test_item in $test_items do PRI_ANS=$(nslookup -query=A $test_item $pri_dns_ip | grep -v $pri_dns_ip | grep Address | awk '{print $2}') #cho $PRI_ANS SEC_ANS=$(nslookup -query=A $test_item $sec_dns_ip | grep -v $sec_dns_ip | grep Address | awk '{print $2}') echo $PRI_ANS $SEC_ANS [ "$SEC_ANS" = "$PRI_ANS" ] && echo match done