So i'm running Debian 9 on one server that serves a website and is also used for email.
When it comes to setting up hosts, hostname, etc, I'm getting irritated by all the info out there specifically for setting it all up with the server itself, the ip address, the webserver, dns records, postfix, opendkim, etc.
I have read the Linode guides, and also other guides, but I'm getting consfused as they are all slightly different everytime. So my understanding (of my current setup is):
DNS points to the one single IP to all registered domains. So lets say I have a fictional domain called 'eidanswebbb.com', and my finctional Linode provided IP is 139.123.345.99 (IPv6 is omitted for now) my DNS entries are:
DNS Manager » gloabl.org
(primary dns) --- (email)
ns1.linode.com --- firstname.lastname@example.org
(nameserver) --- (subdomain)
ns1.linode.com --- eidanswebbb.com
ns2.linode.com --- eidanswebbb.com
ns3.linode.com --- eidanswebbb.com
ns4.linode.com --- eidanswebbb.com
ns5.linode.com --- eidanswebbb.com
(mailserver) --- (preference)
mail.eidanswebbb.org --- 10
(hostname) --- (ipaddress)
www --- 139.123.345.99
mail --- 139.123.345.99
I have the IPv6 parts too, but omitted from here for now. I have email specific spf, dmarc, adsp and dkip in the TXT part and nothing in the SRV part.
In my hosts file in /etc/hosts, I might have any or all of these in it: localhost, alpha, eidanwebbb, eidanwebbb.com www.eidanwebbb.com
So what ones do I REALLY need? I also may want to separate my applications onto different servers at a later date too. So I might have more than one server, the email might run on it's own server, the webserver might be on another, so I might separate www.eidanwebbb.com
and mail.eidanwebbb.com. But maybe that confuses stuff for me for now.
Three files are involved:
127.0.0.1 localhost alpha alpha.eidanwebbb
139.123.345.99 eidanwebbb.com www.eidanwebbb.com
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback alpha alpha.eidanweb
So here are my thoughts attempts to answer my own questions:
Do I need localhost? yes, because the computer itself needs to have a sense of self
Can I have eidanwebbb or alpha? eidanwebbb to signify it's an external server of mine that I SSH into from my local laptop at home but also to help me know it's on the edianwebbb domain (whether it's .com or .net). Do I need alpha too? yes? because if i add another server and move email to it in the future it might be named 'bertie' and eidanwebbb and localhost. Does eidanwebbb become the domain then? So it's alpha.eidanwebbb localhost.eidanwebbb www.eidanwebbb
, and mail.eidanwebbb... do i need to add the TLD to it? alpha.eidanwebbb.com, mail.edianwebbb.com.
So alpha becomes a subdomain in the DNS way of looking.
What becomes my FQDN?
And now onto the nightmare that is Postfix... Actually, I'll leave that for now.
So I've written a lot here, and all I'm looking for is some basic pointers or guidelines.
Thanks a lot for reading, I look forward to the answers.