How to setup DNS server In Linux - Fix DNS resolve issue on a Linux VPS

If you get subscribed with our VPS hosting service you would face issues to browse internet from your VPS while your VPS is accessible from internet. You would get this issue because of wrong name server entries in /etc/resolve.conf file on your Linux VPS. This is known issue with our Linux VM template.

To fix this issue, you are reqired to edit DNS entries:

For CentOS
Edit name server to any public DNS i.e. google dns server in resolve.conf
vi  /etc/resolv.conf

For Ubuntu:
vi  /etc/resolv.conf

Type route command to see kernel routing table. If you see entry in routing table, you will require to delete this entry from routing table of your Ubuntu VPS. the output would look like this:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         69-46-26-33.sta           UG    0      0        0 eth0              *                    U     0      0        0 eth0     *      U     0      0        0 eth0

OR try with ip route command
ip route list

default via dev eth0 dev eth0  proto kernel  scope link  src dev eth0  proto kernel  scope link  src

Issue below command to delete conflicting route:
route del -net netmask     
ip route del dev eth0

If you willing to use alternative DNS / other open DNS service, please also execute below command on Ubuntu VPS:
resolvconf --disable-updates

List of public DNS servers:

Google Public DNS IPv6 Addresses:


Level 3 Public DNS:

Norton DNS IP Addresses:
Option A:
Was this answer helpful? 38 Users Found This Useful (42 Votes)