LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 12-10-2012, 12:15 AM   #1
manya
Member
 
Registered: Apr 2004
Posts: 194

Rep: Reputation: 15
Looking for bash script which can change the DNS records for down hosts


Hi Folks,

I am planning to build DNS system with low TTL and which will also monitor the health of servers or port so if the hosts goes down it will automatically removes that entry from zone and have the traffic diverted from down hosts

Say zone is example.com and have two webservers

www.1.example.com = 30.30.30.30 and www.2.example.com 40.40.40.40.
DNS will monitor the health of both the servers on port 80 through regex and if connection fails it will remove the entry from zone. I am planning to keep the TTL value to something around 180 so that in about 3 mins new entry should be populated and thus reduce the downtime.
 
Old 12-10-2012, 03:55 AM   #2
heinblöd
Member
 
Registered: May 2004
Location: France
Distribution: Slackware Gentoo
Posts: 182

Rep: Reputation: 30
For me it doesn't sound logical.
Simply removing a zone from a DNS Server will not stop incoming traffic for this domain. It would have it's effect maybe after 72 hours, when the records are updated everywhere.

Except in a local network, where you got one dns server and all clients connect only to that one, but for the Internet it sounds pointless to me.

If you only want to stop filling your apache logs with errors, you could maybe have an apache instance for every domain and shut down Apache, if pinging fails

Last edited by heinblöd; 12-10-2012 at 03:58 AM.
 
Old 12-10-2012, 04:19 AM   #3
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6
Posts: 1,416

Rep: Reputation: 434Reputation: 434Reputation: 434Reputation: 434Reputation: 434
Quote:
Originally Posted by heinblöd View Post
For me it doesn't sound logical.
It's fully logical assuming you know how DNS is supposed to work.

Quote:
Originally Posted by heinblöd View Post
It would have it's effect maybe after 72 hours, when the records are updated everywhere.
Again, if you know how DNS is supposed to work you'll know that DNS servers should only cache results for the TTL. It's only when cache DNS servers don't actually respect the appropriate standards that it becomes a problem.

We pretty much do what manya wants to do except that we use an external company (www.tzo.com) to do it rather than in-house scripts.
 
Old 12-10-2012, 06:31 AM   #4
heinblöd
Member
 
Registered: May 2004
Location: France
Distribution: Slackware Gentoo
Posts: 182

Rep: Reputation: 30
Quote:
Originally Posted by TenTenths View Post
It's fully logical assuming you know how DNS is supposed to work.
Well I guess I know, how DNS is supposed to work and I'am aware that DynDns etc are working like this.

But what I mean is that, assuming you know how DNS is supposed to work , the caching name servers will still request the Zone files from the authoritive Server, until they recieve an update saying, the zone is not hosted there anylonger,

So it fail fail for the request to
Quote:
have the traffic diverted from down hosts
And in this case I just think that it takes quite a long time until the requests won't result in a (NXDOMAIN) anymore

Last edited by heinblöd; 12-10-2012 at 06:46 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash/Perl script - provide list of hosts to choose from and ssh to chosen host loadedmind Programming 4 04-07-2010 01:19 PM
DNS NS's in registrar vs DNS NS records sopiaz57 Linux - Networking 7 06-06-2009 06:20 PM
Deleting remote directories on multiple hosts with a bash script zirtik Programming 6 04-16-2009 09:52 AM
script to update /etc/hosts on dhcp obtained ip change. juanctes Linux - General 1 02-02-2008 09:17 AM
DNS Zone Records - MX Records ddzc Linux - Software 8 05-24-2007 01:26 PM


All times are GMT -5. The time now is 03:26 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration