I recently started using linode to host my site. Prior to using linode, I normally used hosting offered by my domain registrar. In those cases, i thought I understood how DNS worked, because the registrar automatically updated your DNS records to point to the server hosing the site.
When following linodes guide, to setting up a website: https://www.linode.com/docs/websites/hosting-a-website
Their instructions tell you to set the DNS servers as:
ns1.linode.com ns2.linode.com ns3.linode.com ...
But the point I am making is, that ANYONE can open an account on linode, and fill in the same DNS settings! So now anyone trying to access your website, could be directed to someone else who wants to pretend to be your site!
Am I correct in understanding how DNS works ? I know that the only way to ensure (from a visitors perspective) that a site being visited is actually the domain intended is to install a certificate (https) etc. But based on the above instructions, it seems almost trivial to pretend to be someone else, if they also use linode.
So what? Someone may use the same DNS servers. But they can't register for the same domain. Once you have registered for
example.org
, you own that domain and nobody else will be able to register for it.You have registered for
example.org
and use the following DNS configuration at Linode:An "evil hacker" may have registered
evil-hacker.com
and uses this configuration:For simplicity's sake let's say that the IP of your site is
1.1.1.1
and the IP of the evil hacker's site is2.2.2.2
. You are worried that because the "hacker" used the same DNS configuration, your siteexample.org
might resolve to2.2.2.2
, right?This is what happens, when I try to resolve
example.org
:org
top-level domain.org
top-level domain and ask it for the IP address ofexample.org
. Theorg
nameserver is managed by your domain registrar. It will look up the information you entered and tells me look at one of the linode nameservers.ns1.linode.com
and ask it for the IP address ofexample.org
. Linode knows which IP your site has and answers me with1.1.1.1
.In the above process, I will never see
evil-hacker.com
or2.2.2.2
. Since our evil hacker (hopefully) can't control the DNS root servers, the nameserver of theorg
top-level domain or the Linode nameservers, all DNS requests for your site will be answered by "trusted" name servers.However, a hacker might intercept DNS traffic from my particular machine. He might install malware that always resolves
example.org
to his IP address2.2.2.2
(e.g./etc/hosts
) or compromise my network router. So using an SSL certificate for your site is still a good idea :).