LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 07-09-2014, 10:23 AM   #1
James0806
Member
 
Registered: Jul 2014
Posts: 30

Rep: Reputation: Disabled
How can i update the dns server ip on multiple systems


In a environment of 20 systems i want to update the dns server ip in all the 20 systems what might be done in easy way
 
Old 07-09-2014, 10:28 AM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,774
Blog Entries: 1

Rep: Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339
Something like:

Code:
#untested, but should be solid
for i in 192.168.1.{2..10}; do ssh $i "sed -i '1s/^/nameserver 8.8.4.4\n/' resolv.conf"; done
which will ssh to 192.168.1.2 through .10 and add nameserver 8.8.4.4 to the top of resolv.conf in each server.
 
1 members found this post helpful.
  


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
Check/Update DNS server settings jau1310 Linux - Newbie 4 06-12-2013 12:09 AM
DNS Server with multiple network zone sikkalgopal Linux - Server 1 03-29-2010 01:52 PM
update dns server with dhcp server bondoq Linux - Networking 1 07-05-2006 12:32 PM
Multiple DNS server's abhijeetudas Linux - Networking 2 09-04-2005 04:34 AM
not possible multiple primary dns server? blackzone Linux - Networking 1 01-19-2005 01:11 AM


All times are GMT -5. The time now is 04:49 PM.

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