Similarly to hostname that can be changed in different ways:
- temporarily using the
hostname
command - permanently using
/etc/hostname
(or/etc/sysconfig/network
or/etc/HOSTNAME
, these files are used by the init scripts)
I want to change my domain name. I can use the domainname
command, but is there a way to make it permanent across reboots? I think it can be configured in /etc/resolv.conf
but this file is generally generated and I don't know exactly the difference between search
and domain
directives. And at what time exactly the information there is passed to the domainname
program to set the domain name?
Do you have any ideas on that?
I'd like to be mostly compatible across distributions. So if if anyone has pointers on the different distributions flavours, I'd gladly accept them.
Best Answer
Set FQDN
I'm using Debian 7 and this is what worked for me; thanks to Fernando Ribeiro.
activate hostname
add domain name and address to the server
VERIFY