Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

Bash – Mass NSlookup

Posted on July 19, 2018 By David Kittell

When you are moving from one server public IP to another you could use some help knowing things are changed.

This bash script will do an NSLookup on various DNS servers.

#!/bin/sh

#  Digkittell.net.sh
#  
#
#  Created by David Kittell on 1/6/18.
#

netDomain="kittell.net"
dnsServerList="68.94.156.132|10.40.20.1|8.8.8.8|192.168.10.21|192.168.10.20|10.40.20.6|208.67.220.220|9.9.9.9|209.18.47.61|4.2.2.2|168.63.129.16|172.26.38.1"

clear
echo "AT&T DNS - Authoritative NS (cbru.br.ns.els-gms.att.net)"
#dig @68.94.156.132 kittell.net | grep ";; ANSWER SECTION:" -A1 | grep -v ";; ANSWER"| sed "s/\t/ /g"
netIP=$(nslookup $netDomain 68.94.156.132 | grep "Address" | egrep -v "$dnsServerList" | cut -d " " -f2)
echo "$netDomain : $netIP"

echo "AT&T Cellular DNS (172.26.38.1)"
netIP=$(nslookup $netDomain 172.26.38.1 | grep "Address" | egrep -v "$dnsServerList" | cut -d " " -f2)
echo "$netDomain : $netIP"

echo "Azure DNS (168.63.129.16)"
netIP=$(nslookup $netDomain 168.63.129.16 | grep "Address" | egrep -v "$dnsServerList" | cut -d " " -f2)
echo "$netDomain : $netIP"

echo "Level3 DNS (4.2.2.2)"
netIP=$(nslookup $netDomain 4.2.2.2 | grep "Address" | egrep -v "$dnsServerList" | cut -d " " -f2)
echo "$netDomain : $netIP"

echo "OpenDNS DNS (208.67.220.220)"
netIP=$(nslookup $netDomain 208.67.220.220 | grep "Address" | egrep -v "$dnsServerList" | cut -d " " -f2)
echo "$netDomain : $netIP"

echo "Google DNS - (8.8.8.8)"
netIP=$(nslookup $netDomain 8.8.8.8 | grep "Address" | egrep -v "$dnsServerList" | cut -d " " -f2)
echo "$netDomain : $netIP"

echo "Quad9 DNS - (9.9.9.9)"
netIP=$(nslookup $netDomain 9.9.9.9 | grep "Address" | egrep -v "$dnsServerList" | cut -d " " -f2)
echo "$netDomain : $netIP"
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

CentOS Code Debian Fedora Mac OSX Raspbian (Raspberry Pi OS) Red Hat Ubuntu UNIX UNIX Shell Scripts Zorin OS

Post navigation

Previous post
Next post

Related Posts

Enable/Disable Desktop Saves

Posted on November 9, 2013October 26, 2015

WARNING: Backup the computer you try these scripts on before you run these. These scripts will enable/disable the ability to save anything to the desktop. Windows Registry Editor Version 5.00 [HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer] "NoSaveSettings"=dword:00000001 Windows Registry Editor Version 5.00 [HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer] "NoSaveSettings"=dword:00000000 Originally Posted on November 9, 2013Last Updated on October 26, 2015…

Read More

Mac OS X Terminal – Get Computer Information

Posted on September 1, 2016December 13, 2016

clear echo "Inventory Script – Running…." # Variables – Start # Get IP – Start netadapter=en0 ip=$(ipconfig getifaddr $(echo $netadapter)) #echo $ip #echo $netadapter counter=1 while [ $counter -le 10 ] do if [ -z "$ip" ] then #echo $counter netadapter=$(echo "en"$counter) ip=$(ipconfig getifaddr "en"$counter) fi ((counter++)) done #echo $ip…

Read More

Ektron Reserved Files And Folders

Posted on October 23, 2013October 26, 2015

The following files and folders are pre-installed/configured by the Ektron site setup. Most of them can be configured through the web.config. FOLDERS %WebRoot%/Assets/ DMS storage location of public uploaded assets %Drive%:/%CustomPath%/AssetLibrary/%SiteName%/ DMS storage location defined during site setup %WebRoot%/AssetManagement/ DMS application files used to upload/view DMS assets %WebRoot%/UploadedFiles/ Where the…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • PowerShell - IIS Remove Site
  • SQLite - Auto-Increment / Auto Generate GUID
  • PowerShell - FTP Upload Directory With Sub-Directories

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • PowerShell - IIS Remove Site
  • SQLite - Auto-Increment / Auto Generate GUID
  • PowerShell - FTP Upload Directory With Sub-Directories
  • Raspberry Pi - Remove Default Apps
  • PowerShell - Change Windows CD/DVD Drive Letter
©2025 David Kittell | WordPress Theme by SuperbThemes