Some questions regarding my system's host file

Hi there,

I would be very grateful if someone could help me and/or point me to the right direction here.

I am setting up my Linode and now I am updating my system's host file.

But the guide is not very specific and I am in doubt now. The content of the referred file is exactly as below (I've only changed, of course, sensitive data):

127.0.0.1 localhost.localdomain localhost
SERVER_IP_IPV4 FQDN SERVER_HOSTNAME
SERVER_IP_IPV6 FQDN SERVER_HOSTNAME

So, is the above correct?

Thanks in advance for your help.

4 Replies

It should be correct. Remember that your fully qualified domain name will generally have your hostname within it. If your hostname is server1 and your domain example.com, then your fully qualified domain name would be server1.example.com. Otherwise, your syntax appears to be correct.

Blake

Great, thank you very much. :)

Hi again,

Even the below part is correct?

127.0.0.1 localhost.localdomain localhost

Here's my /etc/hosts file:

# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1     localhost localhost.localdomain ip4-localhost ip4-loopback
255.255.255.255    broadcasthost

# The following lines are desirable for IPv6 capable hosts
#
::1         localhost localhost.localdomain ip6-localhost ip6-loopback

# Used in IPv6 routing
#
fe00::0     ip6-localnet
ff00::0     ip6-mcastprefix
ff02::1     ip6-allnodes
ff02::2     ip6-allrouters

# My host (v4)
#
111.111.111.111 mydomain.com mail.mydomain.com www.mydomain.com rspamd.mydomain.com Dave

# My host (v6)
#
2600:aaaa::bbbb:cccc:dddd:ffff  mydomain.com mail.mydomain.com www.mydomain.com rspamd.mydomain.com dave

Obviously, the hostnames and IP addresses are fake. mydomain.com, mail, www, rspamd & dave are also A/AAAA records in DNS manager.

-- sw

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct