No, DNS won't make your internet faster
It's a very common thing shitty IT people say: "Oh, your download is slow? try changing your DNS" or "Oh, your game ping is high? try changing your DNS".
However, often, the people that say this only heard it from someone else and just started parroting without verifying it, heck, often without actually knowing what they are even saying.
In this post, I'll explain what DNS is, how it affects your internet usage and when changing it may or may not help.
So without any further ado, let's dive straight into it.
What is DNS?
DNS stands for "
Domain Name System
", we touch it easily a few hundred times a day without knowing it.When you open Facebook, Instagram, WhatsApp, YouTube you touch it.
Heck, you most likely even touched it while getting to my site.
DNS is pretty much everywhere.
The internet works by so-called "IP Addresses
", often "IPv4
" or "IPv6
", though we'll stick to IPv4 for this post, IPv6 is the same, just a different size of address, serving the same purpose.
Each computer accessing the internet has an IP address.
Most of them are in a "public" range, the exceptions to this are the "private networks" defined in RFC1918:
- "10.0.0.0/8
" ("10.0.0.1
" -> "10.255.255.255
")
- "172.16.0.0/12
" ("172.16.0.1
" -> "172.31.255.255
")
- "192.168.0.0/24
" ("192.168.0.1
" -> "192.168.255.255
")
These private networks are intended for your LAN, as to not exhaust the entire space of IPv4 in one go (a thing IPv6 tries to mitigate).
However, as you can see, this can be a pain to remember.
Imagine having to remember that you need to access YouTube through (one of) their IP "216.58.208.110
" (or worse, "2a00:1450:400e:805::200e
" if using IPv6).
Yea, this can become a headache real quick.
Instead, we use the DNS to translate a domain (eg. "www.youtube.com") to the IP they can be found at.
As a lot of people say, DNS acts as a sort of phonebook (for those people old enough to have ever used one).
You can see the DNS in action a bit more by running the following commands in your command-line (I don't have a Mac, sorry not sorry):
Hang on tight while we're loading this image!
Windows: "nslookup www.finlaydag33k.nl"
Hang on tight while we're loading this image!
GNU+Linux: "dig www.finlaydag33k.nl"
How does DNS affect me?
As we've just learned, DNS makes it possible to turn an IP address into something we humans can understand.
Additionally, it also allows us to not have to worry as much about changes.
Back when I launched my new website in August of 2019, I changed the IP address from my hosting at Cloudbear to my IP at home.
However, most of you that were around at that time never noticed this change, as all you had to remember was "
www.finlaydag33k.nl
"!
This also makes it easier for developers as well because instead of hardcoding an IP (eg. "192.168.1.14
"), they can just DNS to resolve it for them.
So they'd just add something like "api.my-app.com
" instead, and if the IP changes, they only have to update their DNS records to reflect this, without having to find all instances of "192.168.1.14
" and replacing it with the new IP.
DNS, however, can also negatively affect you in that the speed of a DNS request can make it feel like websites are slow to load, or games that connect slowly.
Especially on sites like Facebook and YouTube that use multiple different domains to serve content.
For an initial load of Facebook, for example, my PC had to look up these domains:
- "www.facebook.com
"
- "edge-chat.facebook.com
"
- "scontent.xx.fbcdn.net
"
- "scontent-ams4-1.xx.fbcdn.net
"
- "scontent-amt2-1.xx.fbcdn.net
"
- "video-ams4-1.xx.fbcdn.net
"
On YouTube, this was even worse:
- "www.youtube.com
"
- "googleads.g.doubleclick.net
"
- "clients1.google.com
"
- "gstaticadssl.l.google.com
"
- "youtube-ui.l.google.com
"
- "www.google.com
"
- "www.google.nl
"
- "photos-ugc.l.googleusercontent.com
"
- "yt3.ggpht.com
"
- "lh3.googleusercontent.com
"
- "fonts.gstatic.com
"
- "www.gstatic.com
"
- "i.ytimg.com
"
This means that if your DNS server is slow to respond, your device has to keep waiting for a response (or try elsewhere), which can slow down your perceived speed.
However, a lot of devices are smart enough to temporarily store the results of a DNS request in memory, often called "caching".
This means that instead of having to request the addresses for a certain domain from the server again, it just gets the result we have in the memory, which speeds up things.
The main misconception lies here, yes, changing a DNS server may cause the connection to be established faster, however, once your device knows where to send the data, DNS is no longer needed (until the cache gets emptied or expires).
Until that happens, your download speed, upload speed, ping etc. are no longer affected by the DNS.
When to (not) change my DNS?
Okay, so let's talk about when changing DNS may be helpful and when it is unlikely to be helpful.
First, the obvious one: your current DNS is unstable.
Most people use their ISP's default DNS server.
However, your ISP generally doesn't take much care of their DNS server and only tries to "make it work".
Additionally, a lot of ISP-owned DNS servers don't properly cache results, which can cause unnecessary delays.
Often their DNS is overloaded and if it crashes, they aren't in much of a rush to fix it.
In this case, it'd be better to change your DNS.
Second, if you want minimum lookup latency.
Having your DNS server closer-by can decrease latency severely.
A lot of public DNS services have their servers scattered around the planet to make sure there is always a server nearby to decrease latency.
Although it won't be too much of a difference, if you, for example, need to make a bunch of lookups, this latency can quickly add up.
However, unlike popular belief, this latency does not decrease "ping
" in games.
Third, if you want the control.
Some DNS services like CleanBrowsing (paid) and OpenDNS (gratis + paid) allow you to block certain domains, which could be helpful if you have younger children and don't want them to randomly stray onto some "adult" websites or have teens that you don't want to spend their entire evening on Facebook and Instagram instead of studying.
Finally, if you want security.
Using more reputable DNS services like Google, Cloudflare, Quad9 and DNS.WATCH can increase security due to them enabling features like "DNSSEC
", "DNSCrypt
", "ECS
", "DoH
" ("DNS-over-HTTPS
") and "DoT
" ("DNS-over-TLS").
Cloudflare and Quad9 run DNS servers that can be used to block malicious sites (to a certain degree) like those used to control botnets, used for phishing etc.
DNS.WATCH claims to not log any requests made (although, I personally always take this with a grain of salt).
If you want to change your DNS just to decrease game ping or to make uploads faster, then I'm sorry to bring it, this won't do anything.
Bonus: Don't just use 1.1.1.1/1.0.0.1 or 8.8.8.8/8.8.4.4
A lot of people that change their DNS servers often change it to Cloudflare's DNS servers ("
1.1.1.1
" and "1.0.0.1
", among some others) or Google's DNS servers ("8.8.8.8
" and "8.8.4.4
").This, however, is a pretty bad thing to do.
Yes, they do have quick DNS servers and have them quite literally everywhere, but we throw all eggs in our basket.
The issue with this became very apparent on July 17, 2020, when half the internet went down due to an error in Cloudflare's network.
My recommendation would be to spread out the DNS used, or to atleast setup multiple DNS servers for fail-over.
In my own network, I point all clients to my router by default, which has a massive list of DNS servers for fail-over.
Spreading out like this lowers the chance that there will ever be no DNS server available up-stream.
So instead of putting your primary DNS to 1.1.1.1 and your secondary DNS to 1.0.0.1, try setting it to 1.1.1.1 and 8.8.8.8 respectively.
Spread out the points of failure.
Anyways, that was it for now.
I hope you learned a thing or two from this.
And remember, sharing is caring (except with your private keys).
Dismissed.
Comments
Leave a comment
Please login to leave comment!