User Tools

Site Tools


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
scripting/bash/dnssynchro.txt · Last modified: 2020/12/17 04:23 by