[NTLUG:Discuss] dhpcd changes hostname

MadHat madhat at unspecific.com
Tue Jan 4 07:36:14 CST 2000


"Bilbo Baggins .esq hobbit" wrote:
> 
> Hello,
>         I have just recently upgraded from RH6.0 to 6.1. I am using static DSL for internet connectivity. It was working fine
> under 6.0. Something was modified during the upgrade,  which now allows dhspcd ( I think) to change my hostname from,
> "localhost" to whatever the DSL server renames the connection to. I dont know what additional software was installed by
> default and/or config files were changed. I didnt notice having BIND installed previously, but there are several new programs
> installed.      The problem is, that some of the X Windows apps (even the X server) , now stop funtioning correctly until after I
> reboot and the hostname is restored to "localhost". I have spent hours reading, and the only possible resolution I have found is
> to set up an alias ( localhost ) for eth0. But am confused about doing that, because I dont know what the IP address will be
> assigned me on my next connection. I would really appreciate any help, whether a point in the right direction, or a direct answer.
>         One final note. I am not trying to antagonise anyone, but let me state that I have been reading  FAQs, manuals, How-
> to's, and searching the internet for 5 days now, trying to resolve this problem on my own. I am only just now asking for
> assistance, because I have seen from past post all over the internet, how some newbie's questions are sometimes rudely
> handled with the "RTFM" retoric by some. If you are not going to be helpful in a constructive sort of way, dont reply. You arent
> helping the Linux cause when you are rude or obnoxious to newbies, you are just a being a jerk.
>         Thanks ever so much to those of you who do help.
>                                                                 Bilbo Baggins .esq.


Start by making sure there is a line in your /etc/hosts file that reads
something like this:
127.0.0.1       localhost       localhost.localdomain  

OK, check to make sure you have the loopback device set up by typing:
# /sbin/ifconfig -a
you should see something like:
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:3924  Metric:1
          RX packets:36 errors:0 dropped:0 overruns:0 frame:0
          TX packets:36 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
Make sure the line that says UP is there.  

Now, the reason that the name was changed after the install is that the
install saw it was assigned an IP and assumed that the name associated
to that IP would be the name of your machine.  If you just want to
change the name of your machine, edit the file /etc/sysconfig/network
and change the HOSTNAME entry.  

X may be giving you problems because it is not able to connect to the
host listed by hostname (that is a command as well, without arguments it
echoes the current hostname, with a name it will reset the hostname). 
Check the hostname and reset it if you want, but if you don't change it
in the file mentioned above, it will change back when you reboot.

I would suggest looking at your environment as well (just type env). 
Look for the entry DISPLAY and see if it is set to :0 or a name like
localhost:0.  From the errors you describe it may be set to a name, and
if the name is different than what hostname echoes back you would have
trouble with X and X apps connecting. 
You can fix that by running the command xhost.  Run this:
# xhost +`hostname`

Or you can also change the DISPLAY environment variable by running this:
# export DISPLAY=:0

and that may fix your problem.

If none of this answers your questions or doesn't fix your problem,
sorry... and if someone else notices a problem here... Let me know (like
y'all would allow a chance to tell someone they are wrong go by) [[|%^).

-- 
MadHat




More information about the Discuss mailing list