Operating System - HP-UX
1834142 Members
1960 Online
110064 Solutions
New Discussion

Re: changing dns entries in /etc/resolv.conf

 
SOLVED
Go to solution
Jimmy Roux_1
Advisor

changing dns entries in /etc/resolv.conf

Hello,

Let's say I have 100 recovery images (Ignite-UX). If the dns entries in the recovery images' /etc/resolv.conf is no longer valid, what would be the best way to change it without recreating or rebuilding the images?

Thanks,

Jimmy
9 REPLIES 9
Rick Garland
Honored Contributor

Re: changing dns entries in /etc/resolv.conf

The resolv.conf shold only have a few lines. I believe you can only specify up to 3 DNS servers in the resolv.conf. So this file contains 4, maybe 5, lines.

harry d brown jr
Honored Contributor

Re: changing dns entries in /etc/resolv.conf

/etc/resolv.conf does not "hold" dns entries. It simply defines how DNS is to behave.

If you are looking to "push" a new /etc/resolv.conf because you are igniting servers at a different site that have a different DNS server, then you just write a script to push out the new file to each host. if this is the case, then you will also have to address the changes in IP addresses and potentially subnet masks and default gateways.

Your best bet for DNS handling, is to make your hosts DNS Caching servers, and include your other sites DNS server in the search list. Your "other" site should have an active DNS server that can become the master if necessary.

live free or die
harry
Live Free or Die
Jimmy Roux_1
Advisor

Re: changing dns entries in /etc/resolv.conf

Sorry for the confusion:

I should have mentioned entries as in domain and nameserver, not "dns..."

So, if I want to change this in all 100 recovery images what would be the best way without recreating the recovery images?

Thanks again.

Jimmy
harry d brown jr
Honored Contributor

Re: changing dns entries in /etc/resolv.conf

Do you know what they should be BEFORE hand? If so, then just create it in /etc under a different name and when you recover just remsh to the servers and rename the files.

live free or die
harry
Live Free or Die
Pete Randall
Outstanding Contributor
Solution

Re: changing dns entries in /etc/resolv.conf

Jimmy,

I'm just trying to offer some clarification here.

If I understand correctly, you would like to "mass edit" the /etc/resolv.conf files that have been saved in the Ignite images to reflect the new DNS entries.

I don't know the structure of the Ignite images well enough to say if that's possible or not, but hopefully someone else can figure out a way.


Pete

Pete
John Poff
Honored Contributor

Re: changing dns entries in /etc/resolv.conf

Hi,

Take a look at 'man instl_adm'. Ignite-UX has a pretty powerful command set, and one of the things you can do is to use it to specify the DNS settings. Here is a snippet from the man page:


[final] dns_domain = cplx_string
[final] dns_nameserver [index] = cplx_string
[final] dns_search [index] = cplx_string
Sets the domain name services (DNS) domain, one or more name
servers, and optionally, one or more search domains. The index
parameter to the dns_nameserver and to the dns_search keywords
allows more than one name server and search domain to be
configured. The first server and search domain should be
assigned using an index of 0, and the second 1, etc. See
resolver(4) for details.


JP
Jimmy Roux_1
Advisor

Re: changing dns entries in /etc/resolv.conf

That's correct Pete, thank you!

I don't want to go into each image and change the contents manually.
Sanjay_6
Honored Contributor

Re: changing dns entries in /etc/resolv.conf

Hi Jimmy,

Have you explored the iux_postload and port_load_cmds

http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000066936128

the doc id is KBAN00000927.

and the ignite faq,

http://www.software.hp.com/products/IUX/faq.html

Hope this helps.

Regds
Jimmy Roux_1
Advisor

Re: changing dns entries in /etc/resolv.conf

John/Sanjay,

Thanks for the inputs.

Currenlty exploring the first 8KB of INSTALLFS to have the new dns_domain and dns_nameserver and see if that overwrites the recovery image' /etc/resolv.conf entries.

Also, we're looking at the iux_post_config.


Thanks all.

Cheers,

Jimmy