1

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.

2 Answers 2

4

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.

2
  • do i set HOSTNAME to "server.example" og "server.example.com"?
    – Jason94
    Jun 10, 2011 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. Jun 10, 2011 at 14:35
0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .