As a fellow Virgin Media (UK) user I can attest to their poor DNS management. ON the other hand, DNS caching is very common; instantaneous DNS configuration does not exist anywhere (that is, unless you have an intranet with an internal name server). A couple of hours is a typical delay in DNS caches.
On the other hand, there is absolutely nothing that forces you to use your ISPs DNS server (actually, some ISPs do give you equipment that is completely locked and disallow UDP
packets through, but that is not the case with Virgin Media). You should definitely use a nameserver that is trusted by you, not imposed by your ISP.
The nameserver that I'll use for this example is Google's nameserver (8.8.8.8
and 8.8.4.4
). You have two options of setting it:
Configure router DNS
If your router has configuration options for DNS use them, and set them to 8.8.8.8
and 8.8.4.4
. Your router is what provides all DHCP
parameters to your machines and the DNS servers are within these parameters.
If, like me, you're using the latest Virgin Media Super Hub, then you cannot change the DNS configuration of the router. One way to get around it is to configure the VM Super Hub as a modem and use another router as the effective router. That requires you to have/buy an extra router though.
Configure the DNS resolver on your machine
If you cannot reconfigure what nameservers the router presents to you, you can instead configure what nameservers your machine will use. Your question is borderline off-topic for the U&L website since it does not asks explicitly about anything UNIX related. Yet, form the fact that we are on U&L, I'll assume you are on a *nix machine.
The DNS resolver configuration is in the /etc/resolv.conf
file, the file needs to be edited as follows:
nameserver 8.8.8.8
nameserver 8.8.4.4
Yet, if you just edit that file, that configuration will be overwritten by your DCHP
service on any modern *nix system. You also need to configure your DHCP
service to not update DNS information when it retrieves it from the router. The most common DHCP
service today is provided by the dhcpcd
package (I believe).
To configure dhcpcd
to ignore the DNS information it gets from the router (and not overwrite resolv.conf
) you need to ensure that the file /etc/dhcpcd.conf
has no uncommented line as:
option domain_name_servers
Note that several option
s can be set on a single line inside /etc/dhcpcd.conf
. You need to make sure that domain_name_servers
is not present in any of the lines starting with option
.
dig <domain.name>
which gives you a lot of useful information about DNS queries. – grochmal Jun 28 '16 at 16:35