hostname was "ursula", one might have a line in
/etc/hosts which reads
127.0.1.1 ursula.example.com ursula
Technically: The FQDN is the name getaddrinfo(3) returns for the host
name returned by gethostname(2). The DNS domain name is the part after
the first dot.
Therefore it depends on the configuration of the resolver (usually in
/etc/host.conf) how you can change it. Usually the hosts file is parsed
before DNS or NIS, so it is most common to change the FQDN in
/etc/hosts.
If a machine has multiple network interfaces/addresses or is used in a
mobile environment, then it may either have multiple FQDNs/domain names
or none at all. Therefore avoid using hostname --fqdn, hostname --domain
and dnsdomainname. hostname --ip‐address is subject to the same limita‐
tions so it should be avoided as well.
OPTIONS
-a, --alias
Display the alias name of the host (if used). This option is dep‐
recated and should not be used anymore.
-A, --all‐fqdns
Displays all FQDNs of the machine. This option enumerates all
configured network addresses on all configured network inter‐
faces, and translates them to DNS domain names. Addresses that
cannot be translated (i.e. because they do not have an appropri‐
ate reverse IP entry) are skipped. Note that different addresses
may resolve to the same name, therefore the output may contain
duplicate entries. Do not make any assumptions about the order of
the output.
-b, --boot
Always set a hostname; this allows the file specified by -F to be
non‐existent or empty, in which case the default hostname local‐
host will be used if none is yet set.
-d, --domain
Display the name of the DNS domain. Don’t use the command do‐
mainname to get the DNS domain name because it will show the NIS
domain name and not the DNS domain name. Use dnsdomainname in‐
stead. See the warnings in section THE FQDN above, and avoid us‐
ing this option.
-f, --fqdn, --long
Display the FQDN (Fully Qualified Domain Name). A FQDN consists
of a short host name and the DNS domain name. Unless you are us‐
ing bind or NIS for host lookups you can