User Tools

Site Tools


scripting:bash:dnssynchro

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

scripting:bash:dnssynchro [2015/11/30 10:52] – created warnaudscripting:bash:dnssynchro [2020/12/17 05:23] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +To check if the same host has the same resolution on several different DNS (from /etc/resolv.conf) on the same machine: 
 +<code bash>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 
 +</code> 
 +Output shows if the IPs on DNSs are different: 
 +<code bash>Mon Nov 30 10:35:45 CET 2015 
 +192.168.1.10:192.168.1.53 
 +192.168.1.2:192.168.1.54</code>