- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- adding a domain in /etc/resolv.conf
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2013 10:12 PM
02-12-2013 10:12 PM
adding a domain in /etc/resolv.conf
Hi Gurus,
I required to add one domain to /etc/resolv.conf file in more that 50 servers. Remsh is already available from one of the server to all those 50 servers.
Hence could you please help me how can i add one domain entry in /etc/resolv.conf file using one for loop.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2013 12:19 AM
02-13-2013 12:19 AM
Re: adding a domain in /etc/resolv.conf
What is the current content of resolv.conf what do you need to do, add a line to the end?
domain new-domain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2013 12:43 AM
02-13-2013 12:43 AM
Re: adding a domain in /etc/resolv.conf
Hi Dennis,
For example
Current content of /etc/reolv.conf is
cat /etc/resolv.conf
domain aaa.com
nameserver **********
nameserver **********
search bcd.net
I want to add one more domain for searching for example xyz.net
That means after the modification /etc/resolv.conf will look like below
cat /etc/resolv.conf
domain aaa.com
nameserver **********
nameserver **********
search bcd.net xyz.net
I have to add this xyz.net entry to /etc/resolv.conf file in more that 50 servers.
In our scenarion remsh is enabled to all these 50 servers.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2013 12:58 AM
02-13-2013 12:58 AM
Re: adding a domain in /etc/resolv.conf
>to: search bcd.net xyz.net
Perhaps something like:
#!/usr/bin/ksh
# Changes search line in /etc/resolv.conf
for mach in $(< list-of-servers); do
echo "Doing: $mach ================"
remsh $mach "ex /etc/resolv.conf <<EOF
%s/search bcd.net/search bcd.net xyz.net/
wq /etc/resolv.conf.new
EOF
"
done
If you are happy with the results of /etc/resolv.conf.new, you can leave that name out and it will write back to the original file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2013 05:40 AM
02-13-2013 05:40 AM
Re: adding a domain in /etc/resolv.conf
Hi Dennis,
In the servers we have different entries in /etc/resolv.conf.
for eg : some servers we have
search abc.net def.net and in some others we have search abc.net xyz.net etc.
In this scenario can we use the script which you mentioned below.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2013 12:28 PM
02-13-2013 12:28 PM
Re: adding a domain in /etc/resolv.conf
>search abc.net def.net and in some others we have search abc.net xyz.net etc.
I assume in the latter case you don't need to make the change?
If you need to customize the editing, then it is better to make a script and send it to each machine, unless you have a common NFS mounted directory you can use.