You are not logged in.

#1 2017-12-26 17:51:50

Ragadabing
Member
Registered: 2017-04-22
Posts: 14

How to correctly set up servers domain name

Hey,
I've finally got an Arch Linux VPS Server. Yay! But somehow I'm a little bit lost about how to configure my server so that it is correctly accessible through my own domain name (let's say it is example.tld).

By now I configured the DNS Record of example.tld to point to the IPv4 and IPv6 address of my server, and on the server side added at the top of the /etc/hosts the following line:

127.0.0.1    example.tld    example.tld

I'm quite sure I need to change something else too, but not what. The result of

hostname --qdn

isn't example.tld as expected…

Thanks a lot for your answers in advance!

Offline

#2 2017-12-26 18:53:31

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,543
Website

Re: How to correctly set up servers domain name

127.0.0.1 is generally left as localhost.localdomain and localhost.  I'm not sure whether or not putting your external domain name there will cause any problems.  But you do need to add lines to your /etc/hosts file with your external IP addresses, for example:

12.34.56.78 example.tld example
ABCD:1234:ABCD:1234 example.tld example

"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2017-12-26 19:05:17

progandy
Member
Registered: 2012-05-17
Posts: 5,322

Re: How to correctly set up servers domain name

In order to have hostname and hostname --fqdn output different names, you'll have to set up HOSTALIASES, see manpage hostname(7) for more details.

$ hostname
example
$ cat /etc/hostalias
example example.com
$ export HOSTALIASES=/etc/hostalias
$ hostname --fqdn
example.com

| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

Board footer

Powered by FluxBB