no way to compare when less than two revisions

Differences

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


tech:linux:dns_validate [2015/04/09 11:46] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== Validate DNS with nslookup ======
 +To validate that the correct DNS entries are in the DNS
 +
 +**Validate script** (nsvalidate)
 +<code bash>
 +#!/bin/bash
 +HOSTN=$1
 +HOSTI=$2
 +RHOST=`nslookup -type=A $HOSTN|grep Address|grep -v "#53$"|cut -d" " -f2`
 +if [ $HOSTI != $RHOST ]; then
 +  echo "Mismatch: $HOSTN expected $HOSTI but returned $RHOST"
 +fi
 +</code>
 +
 +**Run script**
 +<code bash>
 +#!/bin/bash
 +./nsvalidate someserver1 111.111.111.111
 +./nsvalidate someserver2 222.222.222.222
 +</code>
  

QR Code
QR Code tech:linux:dns_validate (generated for current page)