I’m used to editing /etc/resolv.conf to add nameserver information. So when I recently faced an issue resolving dns queries,
# ping bitbucket.org ping: unknown host bitbucket.org
I tried editing /etc/resolv.conf, but found the following in it:
# cat /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
Apparently the solution is to edit the file /etc/resolvconf/resolv.conf.d/head (Ignore the lines which say the file should not be edited) and add lines like these (Google Public DNS):
# cat /etc/resolvconf/resolv.conf.d/head
Now regenerate resolv.conf with the following command:
# resolvconf -u
ping bitbucket.org PING bitbucket.org (184.108.40.206) 56(84) bytes of data. 64 bytes from 220.127.116.11: icmp_req=1 ttl=54 time=45.9 ms
Joel G Mathew, known in tech circles by the pseudonym Droidzone, is an opensource and programming enthusiast.
His favorite pastime is grappling with GNU compilers, discovering newer Linux secrets, writing scripts, hacking roms, and programs (nothing illegal), reading, blogging. and testing out the latest gadgets.
When away from the tech world, Dr Joel G. Mathew is a practising ENT Surgeon, busy with surgeries and clinical practise.