PDA

View Full Version : Hostname problem....(a very strange one)


sgaray
2007-10-29, 06:06 AM CDT
My name is Sergio, and I have recently installed FC6 with a partial success. My PC (intel core 2 duo) is connected to internet through a router, using DHCP protocol. I read many related Thread about this topic in this forum, but anyone give a solution. Below, there are some of the command I've used to check the hostname of my PC

When I use the command: uname -a, the answer is:
Linux localhost.locald\300\250>2\377\377\377 2.6.22.7-57.fc6 #1 SMP Fri Sep 21 19:45:12 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux
when I use the command: hostname, the answer is:
localhost.locald\300\250>2\377\377\377

I am going to show you some of my config files in order someone can help me to fix it.

/etc/host
::1 localhost.localdomain localhost

/etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=localhost.localdomain

/etc/sysconfig/network-scripts/ifcfg-eth0
# Intel Corporation 82566DC Gigabit Network Connection
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:19:D1:7C:0E:65
ONBOOT=yes
DHCP_HOSTNAME=localhost.localdomain
TYPE=Ethernet

/etc/sysconfig/networking/devices/ifcfg-eth0
# Intel Corporation 82566DC Gigabit Network Connection
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:19:D1:7C:0E:65
ONBOOT=yes
DHCP_HOSTNAME=localhost.localdomain
TYPE=Ethernet

/etc/sysconfig/networking/profiles/default/host
# Do not remove the following line, or various programs
# that require network functionality will fail.
::1 localhost.localdomain localhost

/etc/sysconfig/networking/profiles/default/ifcfg-eth0
# Intel Corporation 82566DC Gigabit Network Connection
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:19:D1:7C:0E:65
ONBOOT=yes
DHCP_HOSTNAME=localhost.localdomain
TYPE=Ethernet

/etc/sysconfig/networking/profiles/default/resolv.conf
; generated by /sbin/dhclient-script
nameserver 192.168.62.1
nameserver 0.0.0.0

/etc/sysconfig/networking/profiles/default/network
empty..

I've tried to change:

/etc/host to:
1:: localhost.localdomain localhost.localdomain
But when a I boot it is replaced by the first describe above.

Can someone give me any clue of how to solve this problem? :confused:

Thank you in advance

homey
2007-10-29, 11:42 AM CDT
Maybe it would help to add this line to /etc/hosts

::1 localhost.localdomain localhost
127.0.0.1 localhost.localdomain localhost

sgaray
2007-10-29, 06:28 PM CDT
Maybe it would help to add this line to /etc/hosts

::1 localhost.localdomain localhost
127.0.0.1 localhost.localdomain localhost

I've tried what you suggested but, but it still does not work.

stevea
2007-10-29, 08:30 PM CDT
Something is scr*wed up.

The system gets it's hostname at boot from the file
/etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=localhost.localdomain

That file *looks* OK, but it may have some unprintable characters.

Edit that file and create a new valid hostname (alphanumerics, no special chars, <255 chars I believe)
So after editing the files last line might read
HOSTNAME=sergio1

After edittting that file set the current hostname to the same with this command.
"hostname sergio1"

Use the command "hostname" and "uname -a" to verify the hostname is now "sergio1"


Now to bring up the interface, first make sure it is down. As root type this in a terminal
window:
"ifdown eth0"

then bring the interface up
"ifup eth0"

You may get some messages, if so post again.

sgaray
2007-10-30, 02:10 PM CDT
Something is scr*wed up.

The system gets it's hostname at boot from the file


That file *looks* OK, but it may have some unprintable characters.

Edit that file and create a new valid hostname (alphanumerics, no special chars, <255 chars I believe)
So after editing the files last line might read
HOSTNAME=sergio1

After edittting that file set the current hostname to the same with this command.
"hostname sergio1"

Use the command "hostname" and "uname -a" to verify the hostname is now "sergio1"


Now to bring up the interface, first make sure it is down. As root type this in a terminal
window:
"ifdown eth0"

then bring the interface up
"ifup eth0"

You may get some messages, if so post again.
Hi Stevea

I tell you what I did:
1) I generate a new "network" file, with sergio1 as a HOSTAME (in /etc/sysconfig).
2) I used the commands that you pass me:
promt> hostame sergio1
promt> hostname
promt> sergio1
promt> uname -a
promt> Linux sergio1 2.6.22.7.57..........
promt> ifdown eth0
promt> ifup eth0
promt> Determining IP information for eth0. Done.

After that I have my hostname OK, but Internet died (I can not connect, for instance to "google"). I reboot the system and It was no possible to load all services, for example "sendmail", and many others were loaded very slowly (for example "cups"). Midnight Commander did not start, also. So I got back to my old network file again, and I restarted the PC . Of course, everything stay as before.

Have you got other idea to try?. I'm hearing you. Thank you.

homey
2007-10-30, 03:56 PM CDT
nameserver 0.0.0.0

I've never seen that one before.

sgaray
2007-11-01, 04:44 AM CDT
I finally could solve the problem. I don't know exactly what was the problem but It is working now!:

I edited "all" files that I quoted above, changing the hostname to sergio1. When I followed the suggestion of Stevea, I only had changed the hostname in the fiile "/etc/sysconfig/network". The only problem that remains is: the machine can not load the sendmail service in the boot time. But it is not a real problem because I do not need it, so I take it away from services loaded at boot time.

Thanks to all.

sgaray
2007-11-08, 03:02 AM CST
HI Landon:

Are you sure that IPv6 are disabled at boot time? You shoud disable the IPV6 at all the level of booting. Sometimes I made a mistake disabling IPv6 in just only one of the level of booting, and that could be your problem.

sgaray
2007-11-08, 11:23 AM CST
Hi

I did it, it the following way:

go to system menu ---> administration--->server setting--->services

when you are there: go to edit and select: edit runlevel all

You will have the IPV6 services which you want to disable. Good luck!.

sgaray
2007-11-12, 03:14 AM CST
Hi Landonmkelsey

I think you should change manually some of your /etc/ files, in the same way I've described above to solve my problem. Be carefull!. Because if you do not change all the files, you could have some disgusting problems, for instance: lost internet connection, and sometimes you will not be able to complete the boot process. Don't worry and do it carefully. Good luck.

Sergio