Sponsored Content
Top Forums Shell Programming and Scripting Want to automate some DNS checks Post 302972845 by pica on Wednesday 11th of May 2016 08:00:41 AM
Old 05-11-2016
Want to automate some DNS checks

I'd like to automate some common DNS checks that I do regularly. I do tech support, part of my job being to walk customers through setting up various DNS records, including SPF and DKIM. Most of these customers are small to medium sized businesses. The first part of the call is always me doing some dig commands to see what the name servers are, what their current TXT records are. Then when we're done I check again this time checking their DKIM, two TXT records with two hosts.

So working manually, first I do a couple basic checks:

Code:
dig example.com NS
dig example.com TXT

Then again to check our work, I run through everything we've done.

Code:
dig example.com TXT

dig examplehost1.example.com TXT 
dig examplehost2.example.com TXT

dig examplehost3.example.com A
dig examplehost3.example.com MX
dig examplehost3.example.com TXT

I don't have any experience with Bash scripting but I think that a Bash script would be the right tool for this job. If it were just a list of commands run on the root domain, it'd be easier but there are host names and so on to insert in front of the domain.

Any ideas and code examples on how to automate this process would be greatly appreciated. By the way, my research into dig has already yielded and improvement. I added +noall +answer to a .digrc file meaning dig now only returns the answer not all the extraneous (to me) information.

Thank you.

Last edited by RudiC; 05-11-2016 at 10:44 AM.. Reason: Changed icode tags to code tags.
 

10 More Discussions You Might Find Interesting

1. Solaris

Solaris DNS Client For Microsoft DNS Server

hey guys, how to add soalris box as a microsoft DNS Client ? and how to register in the microsoft DNS ?? i managed to query from the DNS server after adding /etc/resolve.conf and editing /etc/nsswitch.conf but i need to register the soalris server (dns Client) into Microsoft DNS automatically.... (3 Replies)
Discussion started by: mduweik
3 Replies

2. UNIX for Dummies Questions & Answers

health checks

Hello Anyone please help me with a health check script on HP-UX. (1 Reply)
Discussion started by: mahlathini
1 Replies

3. UNIX for Advanced & Expert Users

Doing Checks on a file

I have a process that I am trying to provide a solution for and have hit a brick wall and would like some pointers in the right direction. Basically on a daily basis a report is automatically generated in a CSV format (FIRST.CSV) which includes codes and amounts in the following format: ... (6 Replies)
Discussion started by: SAMZ
6 Replies

4. AIX

Pre-checks

AIX Guys!!! What pre-checks would you do on a 5.3 server before TL/SP/APAR installation? Bala (2 Replies)
Discussion started by: balaji_prk
2 Replies

5. UNIX for Advanced & Expert Users

DNS server choice: Windows DNS vs Linux BIND

I'd like to get some opnions on choosing DNS server: Windows DNS vs Linux BIND comparrsion: 1) managment, easy of use 2) Security 3) features 4) peformance 5) ?? I personally prefer Windows DNS server for management, it supports GUI and command line. But I am not sure about security... (2 Replies)
Discussion started by: honglus
2 Replies

6. Red Hat

DNS A-Record point to another DNS

Hi, I have a question on how to point the DNS server-1's A-record to second DNS server, which is DNS server-2. So, the computer can access other domain which only listed in the DNS server-2. The scenario is as follow: http://img689.imageshack.us/img689/6333/12234.png How to configure this... (4 Replies)
Discussion started by: Paris Heng
4 Replies

7. Red Hat

DHCP & DNS - Clients get IP but don't register in DNS

I am trying to setup a CentOS 6.2 server that will be doing 3 things DHCP, DNS & Samba for a very small office (2 users). The idea being this will replace a very old Win2k server. The users are all windows based clients so only the server will be Linux based. I've installed CentOS 6.2 with... (4 Replies)
Discussion started by: FireBIade
4 Replies

8. Shell Programming and Scripting

Daily Checks

Hey Guys, I'm seeking some assistance in getting this script to run as a cron job for the user oracle.. the script is basically to perform 2 ADRCI checks... see the script below... i'm getting the following error: /export/home/oracle/Daily_Checks/ADRCI_Daily_Checks.sh: syntax error at line 16:... (7 Replies)
Discussion started by: Racegod
7 Replies

9. Shell Programming and Scripting

Script to do the following checks

Hi , I need a script for processing below scenario. I have to check daily by doing ftp IP to check it is logging or not. So i want this activity to be automated such that if login succesful i will get "FTP LOGIN SUCCESS" in a log file and if fails i want the error message in the same log... (1 Reply)
Discussion started by: sv0081493
1 Replies

10. Solaris

DNS client added to DNS server but not working

Hi, We have built a new server (RHEL VM)and added that IP/hostname into dns zone configs file on DNS server (Solaris 10). Reloaded the configuration using and added nameserver into resolv.conf on client. But when I am trying nslookup, its not getting resolved. The nameserver is not able to... (8 Replies)
Discussion started by: snchaudhari2
8 Replies
Net::DNS::RR::SPF(3)					User Contributed Perl Documentation				      Net::DNS::RR::SPF(3)

NAME
Net::DNS::RR::SPF - DNS SPF resource record SYNOPSIS
use Net::DNS; $rr = new Net::DNS::RR('name SPF spfdata ...'); $rr = new Net::DNS::RR( name => 'name', type => 'SPF', spfdata => 'single text string' ); $rr = new Net::DNS::RR( name => 'name', type => 'SPF', spfdata => [ 'multiple', 'strings', ... ] ); DESCRIPTION
Class for DNS Sender Policy Framework (SPF) resource records. SPF records inherit most of the properties of the Net::DNS::RR::TXT class. METHODS
The available methods are those inherited from the base class augmented by the type-specific methods defined in this package. Use of undocumented package features or direct access to internal data structures is discouraged and could result in program termination or other unpredictable behaviour. spfdata $string = $rr->spfdata; @list = $rr->spfdata; $rr->spfdata( @list ); When invoked in scalar context, spfdata() returns the policy text as a single string, with text elements concatenated without intervening spaces. In a list context, spfdata() returns a list of the text elements. COPYRIGHT
Copyright (c)2005 Olaf Kolkman, NLnet Labs. All rights reserved. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. Package template (c)2009,2012 O.M.Kolkman and R.W.Franks. SEE ALSO
perl, Net::DNS, Net::DNS::RR, Net::DNS::RR::TXT, RFC4408 perl v5.18.2 2014-01-16 Net::DNS::RR::SPF(3)
All times are GMT -4. The time now is 04:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy