Pages

Monday, June 9, 2014

Problem: DNS overwritten automatically in Ubuntu / Debian Server


Sometimes when we work with Ubuntu server we may face DNS resolve problem. If we check resolv.conf file we can see below status.

more /etc/resolv.conf

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)

#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN


Ohh!! That means if I entry my DNS in this file and save it will be OVERWRITTEN!! So?? How to solve this?? No tension its simple…


Just edit below file instead resolv.conf

vim /etc/resolvconf/resolv.conf.d/base

nameserver 8.8.8.8

nameserver 4.2.2.1

[Save and Exit]


Restart Service

/etc/init.d/resolvconf restart


Now check resolv.conf file and you will see this.

more /etc/resolv.conf

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)

#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

nameserver 8.8.8.8

nameserver 4.2.2.1

No comments:

Post a Comment