If you’ve just created your account, or just added a new domain name to an account, you may be surprised that you are unable to view your website when using the domain. Instead you may see:
- An advertisements page, with
?z
being added to the URL. - An error saying “This site can’t be reached”.
This is usually caused by a system called DNS Caching. This article explains how DNS Caching works, why your website isn’t up yet and what you can do to see your website right now.
When will I be able to see my website?
Normally, you should be able to see your website in a few hours. However, depending on the DNS cache on the computer and network of your visitors, it could take up to 72 hours for the website to be visible everywhere.
What does this DNS thing mean?
DNS is the phone book of the internet. DNS allows your computer to take a domain name and look up which IP address it points to, so it can connect to that IP address to load your website.
When you add a domain name to a hosting account, we will automatically configure our servers to send the right data for your domain name, so you can upload a website to it and receive email on it. We do this by setting the appropriate DNS records for your domain.
By changing the nameservers of your domain name, you delegate the control of the DNS records of your domain to InfinityFree. That way, we can automatically configure your domain name to work well with our hosting.
What is DNS caching and why does it take so long?
Generally, DNS records don’t change very often. And looking up DNS records all over the internet takes quite a lot of time and data.
In order to help speed up your browsing experience, most internet providers provide a so-called DNS Resolver. When your computer needs to look up a domain name, your computer will ask the DNS Resolver where to find the domain. The DNS Resolver will then search the DNS system to figure out the IP address of your domain.
A DNS Resolver generally has better connections to the internet than your own device (so it can look up domains faster), but domain lookups still take a lot of time. This is why almost all DNS Resolvers also remember the results of previous DNS lookups, which is called DNS Caching. That way, if you first try to access your website from your laptop and then from your phone on the same WiFi, your phone will receive the data the DNS Resolver remembered from the previous lookup. This means your website will load a bit faster on the phone.
Additionally, your own computer may have it’s own DNS cache as well. But it depends on the operating system and configuration of the device whether it does DNS caching itself.
Usually, DNS caching is useful, because it means that websites will load faster.
However, if you make any changes to the DNS configuration of your domain (e.g. by setting custom DNS records, adding the domain name to an account or changing the domain’s nameservers), your computer and internet provider won’t check for those changes right away. Only when they decide their information is out of date, they will they look up the new DNS records and see the changes.
It’s very hard to say how long the DNS cache lasts. The duration of the cache can be configured by the operator of the DNS Resolver, and is affected by how old the cache is when you first access it. If multiple systems along the line do DNS caching (e.g. your computer and your internet provider), this becomes even more complicated.
What can I do to see my website faster?
InfinityFree updates your domain’s configuration almost instantly when you make the change. And if left alone, your website will be updated on it’s own automatically. However, if you want to get started with your website right away, there are a few things you can do to access your website right away.
Note that these workaround only work for you and the devices and networks you perform these workarounds on. Other people on the internet may still have problems accessing your website until their DNS cache has been updated.
Clear your computer’s DNS cache
You can clear your computer’s DNS cache to force your computer to look up your domain name again. cPanel has written instructions on how to clear DNS cache on various operating systems. You can read their instructions here.
Note that this will only clear the DNS cache on your own computer, not the cache with your DNS Resolver. If your DNS Resolver still has the old records cached, you will not see your website.
Edit your hosts file to override DNS settings
Instead of doing a DNS lookup, your computer also has a so-called hosts file. This file can point domain names to IP addresses on your own computer, and will be checked before any DNS lookup is done. So you can change the hosts file of your computer to point your domain name to your new IP address, before the DNS cache has cleared (or even before any DNS changes have been made).
HowToGeek has a great article on how to make changes to your computer’s hosts file here. You can find the IP address of your website in your client area.
Switch to a better DNS resolver
One of the biggest problems with DNS caching is that DNS Resolvers can cache their results for a long time, and there is no way to clear their caches unless you operate the DNS Resolver yourself.
Fortunately, you are (generally) not forced to use the DNS Resolver provided by your internet provider. Many routers and most devices offer ways to configure your own DNS Resolvers. There are a few great DNS resolvers available for everyone to use. Many of these DNS resolvers don’t cache results as long as the resolvers operated by internet providers, and are sometimes even faster!
A few popular, fast and free DNS resolvers are:
- 1.1.1.1 provided by Cloudflare.
- Google Public DNS.
- OpenDNS.
Which DNS resolver is the fastest for you depends on your location and your network connection. In order to figure out which provider is the fastest (and check some other options) you can use a tool like Namebench to test and compare DNS resolvers.