[SUMMARY] Changing hostname of NIS master

2007-12-25 9:40:00

 Question: How to change hostname on NIS master server

 Platform: Sun Ultra 450, Solaris 2.6 fully patched

I'm going to stick with my original plan which follows. Here are some

of the suggestions I received:

1) You can use ftp with .netrc file to populate the ypservers files to clients

2) Set up an alias in /etc/hosts or netgroups for the new master hostname

   and propogate that. Then redo the NIS servers and master maps. Then

   rename the NIS master.

      This might have worked, except that we are going to be

      swapping two hostnames (forgot to mention that in the

      original post).

3) It may be easier to simply revise the NIS slaves /etc/hosts

   file, and then rerun ypinit to re-establish it's slave status.

      I don't think this would work, the maps on the master need to be

      re-created since they contain the hostname. The slave servers

      would have one hostname and the master would have another.

4) Backup NIS files/maps, use 'sys-unconfig', reconfigure server, recreate

   NIS master.

      This was much more work than I want to do! I've also heard that

      using sys-unconfig on an NIS server can have bad consequences!

5) I was reminded to be sure to have a slave server going during this

   change, so NIS service is not interrupted.

Here's my basic plan:

   1. Rebuild the maps on the NIS master (after hostname change) but don't distribute

         cd /var/yp

         rm *.time

         make NOPUSH=1

   2. Rebuild the ypservers map on the NIS master

         cd /var/yp

         ypcat -k ypservers > /tmp/tmpfile

         <edit /tmp/tmpfile, change hostname>

         makedbm - /var/yp/`domainname`/ypservers < /tmp/tmpfile

   2. Use ypxfr to transfer the new maps from the master to slaves

      (can't use yppush cause the slaves would try to get the maps from the old

      hostname)

   3. Edit the /var/yp/binding/`domainname`/ypservers file on each client/slave

      to reflect the master's new hostname

Thanks to:

Satish B Movva

Matthew Stier

David Evans

Marco Greene

Steve Perez

James Robertori

Brian Parent

Original Question:

>

> Question: How to change hostname on NIS master server

>

> Platform: Sun Ultra 450, Solaris 2.6 fully patched

>

>

> I need to change the hostname of our NIS master. I have gone through

> the archives and FAQ, and have the basics as far as the hostname change:

>

> Modify:

> /etc/hostname.[network-interface] (i.e. le0)

> /etc/inet/hosts

> /etc/nodename

> /etc/net/ticlts/hosts

> /etc/net/ticots/hosts

> /etc/net/ticotsord/hosts

> /etc/X0.hosts (?)

> /etc/bootparams (?)

> /etc/mail/sendmail.cf

>

> I've gone thru the Sun NIS docs, the O'Reilly "Managing NFS and NIS" book, and

> this list's archives, and haven't come up with anything on changing the hostname

> for an NIS master.

>

> Here is a tentative plan for making NIS happy after the hostname change:

>

> 1. Rebuild the maps on the NIS master (after hostname change) but don't distribute

> cd /var/yp

> rm *.time

> make NOPUSH=1

>

> 2. Rebuild the ypservers map on the NIS master

> cd /var/yp

> ypcat -k ypservers > /tmp/tmpfile

> <edit /tmp/tmpfile, change hostname>

> makedbm - /var/yp/`domainname`/ypservers < /tmp/tmpfile

>

> 2. Use ypxfr to transfer the new maps from the master to slaves

> (can't use yppush cause the slaves would try to get the maps from the old

> hostname)

> 3. Edit the /var/yp/binding/`domainname`/ypservers file on each client/slave

> to reflect the master's new hostname

>

> Am I missing anything? Thanks for your help!

>

> Summary to follow.

>

> Dave Foster

>

> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

> David Foster National Center for Microscopy and Imaging Research

> Programmer/Analyst University of California, San Diego

> dfoster@ucsd.edu Department of Neuroscience

> (858) 534-7968 http://www-ncmir.ucsd.edu/

> [All opinions expressed are mine -- duh]

> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

>

  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   David Foster National Center for Microscopy and Imaging Research

    Programmer/Analyst University of California, San Diego

    dfoster@ucsd.edu Department of Neuroscience

    (858) 534-7968 http://www-ncmir.ucsd.edu/

          [All opinions expressed are mine -- duh]

  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Comments

Got something to say?

You must be logged in to post a comment.