FQDN

Good morning,

I've searched in this forum for an answer to this, so please excuse me if this has already been handled.

I am redoing the install of my linode. I have Debian Squeeze as the distro.

I have a little problem understanding what I should do with the FQDN when I edit the /etc/hosts file.

I just set the hostname to "freja".

In the /etc/hosts file, there is currently the following:

127.0.0.1 localhost

127.0.1.1 debian

The following lines are desirable for IPv6 capable hosts

::1 ip6-localhost ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

My IP is 176.58.103.37

I am not quite sure if the FQDN is my real domain name or something I only need to make up. I have googled this but still haven't worked it out.

The thing is that I will be hosting multiple web sites and I have therefore multiple domain names.

1.

So to the /etc/hosts file do I edit it with something made up? Below is a made up domain.

127.0.0.1 localhost

127.0.1.1 debian

176.58.103.37 freja freja.walhalla.com

The following lines are desirable for IPv6 capable hosts

::1 ip6-localhost ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

OR

2.

Do I edit the /etc/hosts file with an actual domain name? Below is a real domain name that I have registered.

127.0.0.1 localhost

127.0.1.1 debian

176.58.103.37 freja freja.beenatural.me

The following lines are desirable for IPv6 capable hosts

::1 ip6-localhost ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

OR

3.

I do nothing and just have the hostname there…

127.0.0.1 localhost

127.0.1.1 debian

176.58.103.37 freja

The following lines are desirable for IPv6 capable hosts

::1 ip6-localhost ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

The last question is the order of the hostname and domain name. I've read that the sequence is important… for example:

127.0.0.1 localhost localhost.localdomain

and not

127.0.0.1 localhost.localdomain localhost

I appreciate any assistance you can give me.

Thank you in advance.

Greetings,

Jasmin

5 Replies

You'll want to put the canonical name of the machine there.

If your domain is example.com something like " freja.example.com freja" would make sense.

Also see http://library.linode.com/getting-start … e-hostname">http://library.linode.com/getting-started#sph_setting-the-hostname as well as "man 5 hosts"

Hi Hawk,

thanks for the reply.

I have read through the link you provided. Which led me to here :) It isn't clear to me, and still isn't. Sorry to be so dumb in the moment. Normally, I can understand tech and linux things fairly well and fast. It's more to understand what the whole procedure is that is important to me.

I also read through the forum again and found this post by "hybinet". He says you shouldn't do anything to the /etc/hosts file unless you really know what you are doing. In the case of a newbie, that means doing nothing :)

http://forum.linode.com/viewtopic.php?f=19&t=8378

I understand from your suggestion that I would input the info using my actual registered domain. But if I have other domains, what happens then?

I am not sure where to look for 'man 5 hosts'. I tried google, this forum and the linode library. No hits came up. I would be happy when you could give me a hint as to where to search.

Thank you for your help.

Jasmin

with the hosts file, you almost got it right, you'll want to pay close attention to the order you list domains though, you want what you choose as your fqdn to listed first after the ip address, ie

11.22.33.44 buster.mydn.com buster

and in /etc/hostname

buster

as for choosing the fqdn, it can be any name you have control over, it will need to be reachable on the internet, forward and reverse dns lookups should match, mainly because it makes mail sent from the linode less likely to be marked as spam by the receiving mail host.

so from your desktop

$ host buster.mydn.com

11.22.33.44

and

$ host 11.22.33.44

buster.mydn.com

for that to happen, you need to create A and PTR records in the DNS

you don't have to worry about all the other virtual hosts your web server will manage as far as your fqdn goes, the fqdn could be one of those, or a totally separate domain, you just need to own it so you can create the dns records.

Thanks a million Chesty. You have helped me a lot with your detailed reply. I appreciate it and will try it out now. Greetings, Jasmin

@mirrabooka:

I also read through the forum again and found this post by "hybinet". He says you shouldn't do anything to the /etc/hosts file unless you really know what you are doing. In the case of a newbie, that means doing nothing :)

http://forum.linode.com/viewtopic.php?f=19&t=8378

I understand from your suggestion that I would input the info using my actual registered domain. But if I have other domains, what happens then?

You'd only need to put the canonical hostname in there. And what this "canonical hostname" business essentially comes down to is that you will have to pick a single name that is to be used in situations where the machine will refer to itself by name, etc.

It's absolutely possible to adopt the ****.members.linode.com name which is set up by default as your canonical name for it, then everything should already be set up correctly without you having to do anything. I suppose that is what hybinet referred to(?).

Of course you may point lots of other names at that same machine and it can then serve different web sites or handle mail for different domains, or whatever services your are interested in, but that's really a different topic.

@mirrabooka:

I am not sure where to look for 'man 5 hosts'. I tried google, this forum and the linode library. No hits came up. I would be happy when you could give me a hint as to where to search.

You would run the command "man 5 hosts" in the command line on your linode to bring up the documentation on the "hosts" configuration file.

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