I'm inexperienced with server administration and in the process of learning how to properly assign a domain name to a server. I'm trying to figure out if I should enter the server's hostname into the DNS zone file as a subdomain, or if this is not necessary.
Here's an overview of what I've done so far, starting from registering the domain and pointing it at the server's IP:
- I've set the server's hostname to "foo" (not actually foo, but it will do for the purpose of the question).
- I've edited /etc/hosts so it contains a line " foo.thedomain.tdl foo".
- I've added "domain thedomain.tdl" and "search thedomain.tdl" to /etc/resolv.conf.
- I've set up reverse DNS for the server to be "thedomain.tdl".
Following a reboot, the output of hostname, hostname -d and hostname -f are "foo", "thedomain.tdl" and "foo.thedomain.tdl", which as I understand is how it should be.
What I'm wondering now is whether I should be doing the following: Add a foo subdomain to the DNS config for thedomain.tdl, so that "foo.thedomain.tdl" is also resolvable from outside the server. Is this necessary/expected for correct operation of services such as mail (send and receive) or HTTP down the line?
If anyone has good general tutorial-with-context style documentation on domain/DNS config and implementation on actual servers to recommend I'd also appreciate it. Thanks!