User Tools

Site Tools


scripting:bash:dnssynchro

To check if the same host has the same resolution on several different DNS (from /etc/resolv.conf) on the same machine:

for dns in `sed -n 's/^nameserver //p' /etc/resolv.conf`; do host -s thehost.toveri.fy $dns | awk '/has address/ {print $4}' > $dns ; done; diff `sed -n 's/^nameserver //p' /etc/resolv.conf` > /dev/null; if [ `echo $?` != 0 ]; then date ; grep [0-9] `sed -n 's/^nameserver //p' /etc/resolv.conf`; fi

Output shows if the IPs on DNSs are different:

Mon Nov 30 10:35:45 CET 2015
192.168.1.10:192.168.1.53
192.168.1.2:192.168.1.54
scripting/bash/dnssynchro.txt · Last modified: 2015/11/30 10:52 by warnaud