How can I correctly change the hostname for ISPConfig and the root domain name?

Discussion in 'Installation/Configuration' started by PeterSGT, Mar 20, 2022.

  1. PeterSGT

    PeterSGT New Member

    Hello

    I have a server with ISPConfig 3 panel.

    The hostname is for example: Name-number1

    The domain name is:
    firstname-lastname.com

    On this server I now have wordPress sites from other users.

    When they send emails from their sites, the preview of the original message shows the hostname and the root domain.

    I want to change the hostname to a different one, and the root domain to a different one, so that my name does not appear in their emails.

    For example:

    Other-name-host.other-domain.com

    I thought I could change the hostname and domain directly in the ISPConfig panel.

    1)
    What happens if I change the hostname and domain directly in the ISPConfig panel?

    The server already has the websites, databases and mail of other users configured.

    If the ISPConfig panel changes the hostname and domain correctly e.g. in databases and mailboxes I understand that I also have to correct this in my clients' website files etc.

    2)
    Is there any other way for SMTP server not to add its hostname together with main domain name in headers? - if yes, where can I set it?

    3)
    Will changing just the name in [System] > [Server config] execute all changes of this name, in all services and will they work properly after such change?

    Regards
    Peter
     
    Last edited: Mar 20, 2022
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    That's not the case, ISPConfig does not provide an option to change the hostname.

    To change the hostname, edit the file /etc/hosts, /etc/hostname and /etc/mailname, and restart the server.
     
  3. PeterSGT

    PeterSGT New Member

    Thank you for your help.

    I have edited the files provided.
    But I don't see that the server name has changed.
    Still, everything seems to work as it did before.
    I haven't checked email shipping yet.

    This VPS server has external IP 11.22.33.44 and internal IP 88.88.88.88

    And after rebooting the system, the /etc/hosts file
    Looks like this:


    127.0.0.1 localhost.localdomain localhost
    11.22.33.44 new-name.new-domain.com new-name

    ::1 localhost ip6-localhost ip6-loopback
    ff01::1 ip6-allnodes
    ff01::2 ip6-allrouters

    # Auto-generated hostname. Please do not remove this comment.
    88.88.88.88 old-name

    In the file:
    /etc/hostname
    Assign the previous old name to exist.

    Only on file:
    /etc/mailname
    there has been a permanent change and the new domain is there


    Before I did the editing of these files, I added new DNS entries and a new page in the ISPConfig panel.

    New-domain.com

    And I checked to see if it was working.
    At this point, I can still log into the ISPConfig panel via the previous subdomain.
    But logging into the ISPConfig panel from the new sub domain does not work.
    What can this be caused by?

    Maybe I should do a restart in some other way instead of the reboot instruction (SSH)
     
    Last edited: Mar 20, 2022
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    You missed adding the new subdomain in DNS and you missed removing the old subdomain from DNS. For ISPConfig, it does not matter which subdomain you use as it listens on all domains and subdomains on port 8080 anyway.

    Btw. Fater changing the hostname, you should create a new SSL cert by running:

    ispconfig_update.sh --force

    and chose to create a new SSL cert when the updater asks. But take care to fix your DNS issue first, as you won't get a new Let#s Encrypt SSL cert without valid DNS records.
     
  5. PeterSGT

    PeterSGT New Member

    Thank You for your help !

    I made a mistake at some point and everything stopped working ;-(

    But I sat up all night and managed to restore everything to the state before modification.

    Now I re-did everything in that order:

    1. I used the old hostname as a subdomain by adding it to the new domain in the provider's DNS.

    oldNameHost.NewNameDomain.com

    2. I waited for DNS propagation

    3. Then in the ISPConfig panel I created a DNS zone for this subdomain as a domain:
    oldNameHost.NewNameDomain.com
    Selecting the creation of a SSL certificate

    4. I checked in the browser - everything is OK, - there is a certificate on this domain correctly generated.

    5. So in /etc/hosts file I changed only domain itself (host name which is subdomain stayed old)

    6. I also changed the domain in the file:
    /etc/mailname

    7. I ran the command:
    ispconfig_update.sh -force

    8. Everything went fine (I know that after this description the reader will think where the problem is ...)

    9. I logged in under the new root domain and it's OK

    But I still see the old name in the ISPConfig panel:

    oldNameHost.OldNameDomain.com

    But in the given files (/etc/hosts, /etc/hostname and /etc/mailname) the write are as expected:

    oldNameHost.NewNameDomain.com

    Is there any command that will update this now in the ISPConfig panel?

    As a test I created a new domain and it also creates with the old names,
    I also did a server reboot and it is still like this.
     
  6. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Where, exactly?
    What is created with old names? Is the new domain e-mail domain, DNS domain or new website?
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    You can change it in ISPConfig under System > server services if you want. But it has no influence on how the server is working, it's just a name. So nothing got created with the old name.
     
  8. PeterSGT

    PeterSGT New Member

    Super thanks for your help! Is OK
     

Share This Page