LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-11-2013, 05:23 PM   #1
jau1310
LQ Newbie
 
Registered: Jun 2013
Posts: 2

Rep: Reputation: Disabled
Question Check/Update DNS server settings


I'm trying to find a script that check DNS settings in my SUSE machines. I want to run this script so several servers are checked and if needed updated.

Any idea? Thanks in advance.
 
Old 06-11-2013, 08:30 PM   #2
ShadowCat8
Member
 
Registered: Nov 2004
Location: Ontario, CA
Distribution: Gentoo, Arch, (RedHat4.x-9.x, FedoraCore 1.x-4.x, Debian Potato-Sarge, LFS 6.0, etc.)
Posts: 241

Rep: Reputation: 52
Greetings,

When you say "check DNS settings", what exactly are you referring to? Properly configured DNS on the network? An NIS setup across the network?

If you have properly configured DNS on your network, then there should only be the DNS server that you need to check since all other systems on the network should be getting their DNS from that one server.

Now, you could be needing to check /etc/resolv.conf of the different servers to make sure that they have the "nameserver <DNS.server.ip.addy>" entries, but once that is set, it shouldn't change without someone having root access to the box and going in and manually changing it.

The last thing I think you might want to check would be the /etc/nsswitch.conf file which tells the system in which order to check host entries, like:
Code:
...<snip>...

hosts:       files dns
networks:    files dns
In the above snippet from my /etc/nsswitch.conf file, you can see that I am checking my local /etc/hosts file before my system goes out to check any DNS servers. If I had an NIS setup on our network, I would have the entries for those two lines as "files nis dns".

-----
Now, as a thought before I submitted this response: Are the servers that you want to check using static IP addresses or are they running DHCP?
If they are getting their network information from DHCP, then the control of where you are pointing for DNS generally starts at the DHCP server since it should be passing the preferred DNS server information with the newly-leased IP address for the system. There is the possibility of overriding it with local administrator configuration settings for the specific system. Again, that would require someone going in as root (or with root privileges) and setting up those configuration settings.

HTH. Let us know.

Last edited by ShadowCat8; 06-11-2013 at 08:35 PM.
 
1 members found this post helpful.
Old 06-11-2013, 10:01 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,411

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
As above, its not clear exactly what you want to check.
You can try the following (syntax check)
Code:
service named configtest  # rhel based; suse may have an equiv
dig cmd http://www.madboa.com/geek/dig/
nslookup http://www.tecmint.com/8-linux-nsloo...n-name-server/
 
1 members found this post helpful.
Old 06-11-2013, 10:54 PM   #4
jau1310
LQ Newbie
 
Registered: Jun 2013
Posts: 2

Original Poster
Rep: Reputation: Disabled
Follow Up

Thanks a lot for your terrific explanation.
Here's the situation:
What I'm looking for is a script capable of updating /etc/resolv.conf as my organization DNS servers had changed. I don't want to go 1 by 1 updating that information, I'm talking about more than 300 servers.

I do have one that does that for windows (forgive me the bad word )...it reads the server list from a txt file and then compare the DNS settings against a list of valid ones. If needed, a flag can be placed to update them or to just give a report of current settings.

In a nutshell, my organization changed DNS servers and I need to update that info in more than 300 servers....

Thanks a lot.
 
Old 06-12-2013, 12:09 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,411

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
Well, updating a file across 300 servers would normally be done via a bash script, utilising scp with auth-keys instead of using a passwd.

Of course, for that num of systems, in the long run a cfg management system like Puppet of Chef would be worth looking at.

You can start creating a script based on the MSwin one, but using bash instead; these links may help
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://www.tldp.org/LDP/abs/html/
http://rute.2038bug.com/index.html.gz

although this sort of thing is fairly common and you can probably google a soln or 2.
Have a go and come back if you get stuck.
 
  


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
Where do I put DNS settings for my DHCP server? IanVaughan Linux - Networking 1 02-10-2010 10:39 AM
dns server settings pclos2007 blinton Linux - Newbie 2 10-08-2007 04:32 PM
Network settings / DNS Server settings uid0sd Linux - Newbie 3 02-22-2007 04:39 PM
DNS server settings FC5 mickza Linux - Networking 1 01-28-2007 09:34 AM
How do I keep my DNS server settings set? hamster Mandriva 3 10-28-2006 08:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:54 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration