How to configure my Linode adding my own domain

I was told by the support team that each Linode is given a name independent of anything else, so there's no need for a domain if I don't want one.

However, I already purchased a domain name, so my simple question is: will I have to configure my Linode with both domains?

Supposing I registered the domain 'llehirgen.org', and that my Linode is given the domain 'something.linode.com' with ip address 12.34.56.78, I wonder how do I have to configure my DNS zone file and my /etc/hosts file.

Will the following configurations be correct?

DNS zone file

llehirgen.org            CNAME   something.linode.com.
something.linode.com     A       12.34.56.78

something.linode.com     NS      ns1.linode.com.
something.linode.com     NS      ns2.linode.com.
...

/etc/hosts

127.0.0.1       localhost.localdomain                     localhost
12.34.56.78     hydrogen.something.linode.com         hydrogen
12.34.56.78     hydrogen.llehirgen.org                hydrogen

3 Replies

That is correct, the domain is optional, since the server will work fine with just an IP address (well technically more than one because of IPv6).

But most people want to access their server by name and not by IP. So you setup an A record (IPv4) and an AAAA record (IPv6) in your DNS, then tell your domain registrar to point to your DNS servers. You may use your own DNS server (nsd or bind, under CentOS 7) or you may use the DNS servers provided by Linode.

So, when you try to access your domain.tld, the resolver will contact the root .tld ask for the DNS servers of domain.tld (for example nsX.linode.com), then propagate the request directly to the provided DNS servers, which in turn will resolve domain.tld for the client.

You do not need to modify your /etc/hosts file, your own address will already be resolvable by your DNS.

@IfThenElse Thank you for your help.

So, as you suggest, I would avoid to add two Fully Qualified Domain Names (FQDNs) in my /etc/hosts file.

The following entries should be enough:

127.0.0.1        localhost
12.34.56.78     hydrogen

My main concern was to preserve both domains, the one given by Linode and the one I purchased, because I may not renew the latter.

So, once it is expired, my application can still be referenced using the linode.com domain.

That's why I thought of adding the CNAME record in the DNS zone files (at Linode and at other DNS provider of my choice) and using the linode.com domain for the remaining records.

well, typical use of the /etc/hosts file, is when a system can't resolve addresses (offline, private network, no dns, etc) or when you want to override an address (DNS propagation hasn't finished… well propagating), or even when you have a large network of servers and you want somewhere to write their names & IP addresses, for admin reference (where was that OS/2 server… I built 20 years ago… I know its somewhere here…).

in your case, it doesn't really make a difference…

since you don't really expect to keep the purchased domain, then you could just remember the IP address and use that, instead of a domain name. I know many IP addresses by heart, I am my own resolver, for my private servers that aren't accessible by others.

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