Operating System - HP-UX
1830932 Members
2455 Online
110017 Solutions
New Discussion

how to change hostname and domain name ?

 
Eric_83
Occasional Advisor

how to change hostname and domain name ?

I have a dns server .

I want to change dns server's hostname and

domain name .

I modified /etc/hosts , /etc/resolv.conf

I restarted the named daemon .

But when I use nslookup command check the domain
I discovered there is no change in hostname.

how can i do ?
cool_boy
11 REPLIES 11
KCS_1
Respected Contributor

Re: how to change hostname and domain name ?

hi~

you can change hostname,

follow instruction:

# vi /etc/hosts (hostname change)

# /sbin/init.d/hostname start

# nslookup your_hostname

after, confirm the /etc/nsswitch.conf
Easy going at all.
KCS_1
Respected Contributor

Re: how to change hostname and domain name ?

hi~

you can change hostname,

follow instruction:

# vi /etc/hosts (hostname change)

# /sbin/init.d/hostname start

# nslookup your_hostname

after, confirm the /etc/nsswitch.conf file

also you can change resolution suffix

#vi /etc/nsswitch.conf

hosts: files [NOTFOUND=continue] dns
Easy going at all.
harry d brown jr
Honored Contributor

Re: how to change hostname and domain name ?


set_parms


live free or die
harry
Live Free or Die
Animesh Chakraborty
Honored Contributor

Re: how to change hostname and domain name ?

hi,
Also change /etc/rc.config.d/netconf file
Did you take a backup?
sven verhaegen
Respected Contributor

Re: how to change hostname and domain name ?

as you are running DNS , changinh hostnames and domainnames isn't that simple I'm afraid .. it depend where the server is going to get its data himself , is it set to use DNS for it's own domain and resolving or not ??? if it uses DNs then the chages need to be taken care not only in resolv.conf but also in the DB (database files) created by DNS at startup, you wil physically need to alster the hostname in the DB file or alter things in the named.conf or named.boot and hostfile and run host_to_named script to remake the DB before restarting named...
...knowing one ignores a greath many things is the first step to wisdom...
John Dvorchak
Honored Contributor

Re: how to change hostname and domain name ?

The easiest way to change a systems host name and most network setting is set_parm. If you want to see everything then use:
set_parms initial.
That will take care of the sytem you are on. You didn't mention if that system is your DNS server also? If so you will have to look at /etc/named.boot to get the path to the db files and change the forward and reverse entries for the system there. Don't forget to restart named to re-read the newly edited db files.

If the DNS server is on another system then you will have to contact the SA on that system to make the appropriate DNS DB settings on the DNS server.
If it has wheels or a skirt, you can't afford it.
harry d brown jr
Honored Contributor

Re: how to change hostname and domain name ?

Eric,

There is a feature in your profile that allows you to find previous Questions you have posted, which makes it easier to take care of this:

This member has assigned points to 0 of 18 responses to his/her questions.

http://forums.itrc.hp.com/cm/TopSolutions/1,,CA821024!1!questions,00.html


As Animesh as said, don't forget netconf file.


live free or die
harry


Live Free or Die
Sritharan
Valued Contributor

Re: how to change hostname and domain name ?

Hi Eric

you can use set_parms

to set hostname
set_parms hostname

to set dns
set_parms addl_netwrk


Thanks & Regards
Sri

Known is a drop...unknown is an ocean -> quote from a movie
Sritharan
Valued Contributor

Re: how to change hostname and domain name ?

opppppssss

sorry I missed out this

you also can use SAM to set your netwoking parameters

to add host
Networking & Communication -> hosts

to add DNS
Networking & Communication -> DNS

Thanks & Regards
Sri


Known is a drop...unknown is an ocean -> quote from a movie
MANOJ SRIVASTAVA
Honored Contributor

Re: how to change hostname and domain name ?

Eric

you need to cehck how the nslokup resolve its name .

Set it to check it /etc/hosts file first .

change the apropiate entrty in /etc/hosts

set_params hostname


reboot it



Manoj Srivastava
Bill McNAMARA_1
Honored Contributor

Re: how to change hostname and domain name ?

if you change the /etc/rc.config.d/netconf
and
/etc/hosts, /etc/resolv.conf
you can then do a /sbin/init.d/net stop
/sbin/init.d/net start
to reload the config.
set_parms will more or less do the same thing, but ask you to reboot.

Later,
Bill
It works for me (tm)