Solved Hostname change does not work properly.

castris

Verified User
Joined
Apr 16, 2021
Messages
66
Location
Arcenillas
At first I associated it with the fact that I am a novice, but I have been preparing my templates for different VPS deployments with Directadmin for two days and I have encountered the same problem everywhere.

The hostname change model server-Ip.IP.IP.IP.da.direct. does not work:
- Neither in `Dashboard >> Admin Settings >> Server Settings`
- Neither via shell: `hostnamectl set-hostname server.mydomain.com` The latter changes at the server level, but Directadmin continues to think of the other name.

This is what I have read.


Apart from what is known in Linux.

## Steps and details
- The server has a correct `myhostname.domain.tld`
- The server responds with `hostname -f` with `myhostname.domain.tld`
- The IP has a PTR that resolves to the same hostname.
- It has been restarted several times "just in case"

However, whenever we request a certificate with `cd /usr/local/directadmin/scripts && ./letsencrypt.sh request_single myhostname.domain.tld` the creation of `server-IP-XX-XX-XX.da.direct` appears.

I have performed a search on the server to locate the string `server-IP-XX-XX-XX` without result.

I am starting to feel annoyed, and lost.

Seriously, it cannot be that such a simple thing, destroys software that seems so beautiful.

## NOTE
The passage of time also takes its toll on the collection of information sources on certain subjects, and new documentation has the same defect that we all have who make software. We write for ourselves without taking into account that the reader may have knowledge, but what he is looking for is knowledge of the environment in which he is currently immersed.
 
in the /etc/hosts do you have set correctly ip to the new hostname for both ipv4 and ipv6 if you have such

if not it will issue server-ip-xx-xx-xxx.da.direct - address

I notice that it on some Ubuntu iso installs i did recently as issue I received server-address...

no Issues on Debian iso install..
 
in the /etc/hosts do you have set correctly ip to the new hostname for both ipv4 and ipv6 if you have such

if not it will issue server-ip-xx-xx-xxx.da.direct - address

I notice that it on some Ubuntu iso installs i did recently as issue I received server-address...

no Issues on Debian iso install..
Ok.

I forgot the most basic thing.

Write down each and every issue that the system administration has to do with this

Of course it is verified

```
root@amazzal:/usr/local/directadmin/scripts# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost

::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
XX.XX.XX.XX amazzal.mydomain.tld amazzal
```
I have tried, of cousre seacrh chain: `server-XX-XXX-XX-XX.da.direct` in `/etc` and in `/usr/`

Nothing.
 
I do not remember what exactly do as steps

if I remember had hostname set to 127.0.0.1 and for that reason received server-ip-xx... hostname by default

and I have active ipv6 nothing set but nothing for it - do not know what bugged

to change it i fixed the host file, changed

/etc/hosts file to

X.XX.XX.XX hostname.mydomain.tld hostname
ipv6:XXXX:XXXX:XXXX:XXXX hostname.mydomain.tld hostname

/usr/local/directadmin/conf/directadmin.com

servername=hostname.mydomain.tld


/usr/local/directadmin/custombuild/options.conf

redirect_host=hostname.mydomain.tld

then delete old certificate

at /usr/local/directadmin/conf/

(do not remeber ) if i did da build rewrite_confs - but I think I did it

and then reissues ssl
/usr/local/directadmin/scripts
./letsencrypt.sh request_single `hostname -f` 4096
 
Next time set the correct hostname before DA installation then it will automatically be picked up.

So both the hostname and hostname -f command should give the full FQDN hostname, so /etc/hosts and /etc/hostname should contain the full hostname.

Also for doing this and for changing afterwards, there is a manual written by me.
 
Since I have more than 100 VPS managed and 5 VPS for shared hosting, I cannot afford to install from scratch every time I have something new to install.

I use templates, about 5 different ones.

And therefore when cloning the template in a new kvm I need to change the hostname.

That is why, apart from the automatic changes of linux, of directadmin, I cannot allow any trace of the original template to remain.

I have been confused about how the dashboard works, and why I could not find the name of the original installation, which in the end I only found in a compiled file.

But that's it, I only have to check and test the DNS cluster this weekend, and I could move the migration of my computers to production.

I needed to know Directadmin thoroughly and this is the best fight.

Thank you very much anyway for the forum and the help.

Anyway, as I use it, my Spanish wiki will grow, and I usually leave it public and with updates according to the new versions, behaviors will change.

Thanks to the people of Directadmin and you for your How-To's.

Best regards.
 
Back
Top