Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I own a hostname; let us say it's example.com

I want my box I installed Fedora on to be called "server". Now, I've opened /etc/sysconfig/network and it has the following:

NETWORKING=yes
HOSTNAME=localhost.localdomain

Would the correct thing to do be to change HOSTNAME to HOSTNAME=server.example.com?

I have already run hostname "server" in the terminal.

share|improve this question

2 Answers 2

up vote 4 down vote accepted

The hostname of your server does not need to match the domain name from which you can reach it from the Internet. I'm guessing you're trying to set up this server as a web server or otherwise hosting some service available from the Internet.

Your domain name has DNS name servers associated with it; you need to configure those name servers to respond with your Linux server's public IP address when queried. Most likely, you can do this through your registrar's control panel since some registrar's will host DNS for you.

For example, if your server can be reached from the public Internet at IP address 12.3.45.67, then you would want to configure DNS so requesting the A record for server.example.com responds with 12.3.45.67.

share|improve this answer
    
do i set HOSTNAME to "server.example" og "server.example.com"? –  Jason94 Jun 10 '11 at 9:34
    
It doesn't matter if the goal you are trying to achieve is to make this a public web/ftp/other server. –  Stephen Jennings Jun 10 '11 at 14:35

The simple answer is that yes, to make the change that you made with the hostname command permanent you should change /etc/sysconfig/network so that it says:

HOSTNAME=server.example.com

That will cause hostname server.example.com to be run when you boot the machine in future.

share|improve this answer

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.