Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I set a new hostname on my machine using:

sudo hostname NEWHOSTNAME

Then I restarted, and tried accessing the internet and nothing happened. I checked the hostname and it was set to localhost.localdomain.

How can I reset my configurations so that I am again connected to the web?

I'm running Red Hat Enterprise 6.0 (Santiago)

share|improve this question
    
what exactly did you do to change the hostname? –  Wojtek Rzepala May 21 '12 at 14:03
    
I did: sudo hostname NEWHOSTNAME –  SortingHat May 21 '12 at 14:15
2  
This changes the hostname until you reboot. Maybe you did something else ? –  Ben D May 21 '12 at 16:34
    
Agreed with @BenD: the original hostname would be restored after the reboot. –  Wojtek Rzepala May 21 '12 at 16:48
    
Thanks guys, I wasn't sure if it was a persistent change or not. Thanks for all the info! –  SortingHat May 21 '12 at 18:22
add comment

3 Answers

up vote 5 down vote accepted

Your hostname should have nothing to do with being able to connect to the internet. That is unless the DHCP server on your network assigns IP addresses based on hostname (which if it does, it's a big mistake).

If the internet loss you mention is on a home network, consider restarting your local router. If it's a public or work network, unplug the cable/disable wireless, wait a few seconds and try plugging/enabling again.

If you still have problems, ask your local administrator. If you are your local administrator, follow the steps here or ask for support.

share|improve this answer
add comment

In centos 6, clean. I change the /etc/hosts file to add a fqdn, like:

192.168.1.118 mail.sla.com mail

before I change the file /etc/systemconfig/network an add a name different a localhost.localdomain, like:

HOSTNAME: mail

next, I execute yum install bind, and result is "couln't find centos.mirror...."

ping to dns of isp... nothing

What would be the explanation for that?

share|improve this answer
add comment

As someone already mentioned, check the file /etc/sysconfig/network

NETWORKING_IPV6=no

HOSTNAME=

NETWORKING=yes

GATEWAY=

the HOSTNAME entry on this file will make the hostname of the server permanent after restart.

Restart nettwork

$ service network restart

Ping the entry GATEWAY IP address to check connectivity. If this is a home network, it would be your router.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.