Changing servers hostname

Discussion in 'Installation/Configuration' started by rbartz, Sep 15, 2006.

  1. rbartz

    rbartz Member HowtoForge Supporter

    Can you tell me the way to change a server's hostname so that everything works? It seems whatever I try, it creates a problem. The server is leased, when they installed Fedora Core 3, they assigned the server as 66-226-75-8.

    We have about 15 domains on it now, but are having mail issues among other things. The mailog is full of warnings about the hostname not being FQDN, the hostname being numeric. It suggests naming the host in postfix/, but that causes all kinds of internal loop problems, as in thousands of undeliverable mail notices in a couple of mailboxes. :( Changing the hostname creates problems with local mail delivery too.

    the output of hostname is:

    the output of hostname -f (the place no doubt to begin!)
    hostname: Unknown host

    the /etc/sysconfig/network says:

    The /etc/hosts file says:
    == localhost.localdomain localhost
    == is a FQDN that points to the server and is a domain installed with ispconfig

    Finally, when I set the hostname to with
    [[email protected] etc]#hostname

    and restart postfix, the warnings stop but postfix from then on bounces a lot of mail with this in the log:
    Sep 14 19:07:48 66-226-75-8 postfix/smtp[3864]: A7A169543EA: to=<[email protected]>, orig_to=<[email protected]>, relay=none, delay=0, status=bounced ([]: Name or service not known).

    Thanks for helping me out on this.


  2. rbartz

    rbartz Member HowtoForge Supporter


    I will answer myself :) in case anyone else has the same problem with a leased server:

    1. in /etc/sysconfig/network set the hostname:


    2. In /etc/hosts set the ip with your new hostname localhost.localdomain localhost

    3. reboot

    You do not need to change anything else in ispconfig, postfix, etc, all should come together on the reboot. Now the mail uses for hostname and spamassassin is happy and no loops and everything seems right.
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    On some linux distributions you will have to chnage /etc/hostname too.
  4. rbartz

    rbartz Member HowtoForge Supporter

    Yes, I see that. I had done that earlier in other attempts to bring this to some resolution, although I had not set it to the full server name I used.

    Now, if I could just get suPHP to work I would have the "perfect server"... :)

    Thanks for the added advice Till.

Share This Page