Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm in Viet Nam and most social websites (Facebook, Twitter and the likes - even reddit) are blocked by the ISP DNS server.

I tried to change the DNS server of my Arch box using the resolv.conf file, but it failed miserably since dhcpd generates this file automatically everytime I connect to the LAN. I've been looking around to try and find out how to fix this, without success. Either I s*ck at Googling, either it is non-trivial to do so.


Meh, apparently posting it here made me feel guilty and I had to push my search a bit more. I found the same article than Ankur post below. This is what I made, if anybody ever faces the same problem:

$ sudo gvim /etc/dhcpcd.conf 

Add "nohook resolv.conf" at the tail of the file.

$ sudo gvim /etc/resolv.conf

Add to the file (OpenDNS servers):


Or (Google DNS):


Then, verify it worked (need package dnsutils):

$ dig

; <<>> DiG 9.9.1-P1 <<>>
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 16994
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

; EDNS: version: 0, flags:; udp: 4096
;      IN  A


;; Query time: 87 msec
;; WHEN: Thu Jun 28 00:43:23 2012
;; MSG SIZE  rcvd: 61

See ;; SERVER:, it worked.

share|improve this question
Consider also using Tor to bypass censorship and network blocks. – Dakatine Jun 27 '12 at 12:34

2 Answers 2

up vote 4 down vote accepted

Arch Wiki explains: either use a resolv.conf.head file, or write-protect /etc/resolv.conf.

share|improve this answer
this is honestly what resolv.conf.head is designated for. write-protecting resolv.conf doesn't seem like an elegant solution. – spyroboy Jun 27 '12 at 18:30
This answer is out-of-date; nowadays, best-practice (if using dhcpd), is adding the change to dhcpd's configuration instead, so the correct resolv.conf is generated. (See the linked wikipage; something like static domain_name_servers= at the bottom of /etc/dhcpcd.conf.) – ELLIOTTCABLE May 20 at 17:41

The file '/etc/resolv.conf' generally should not be edited by hand. Most linux systems use a program called 'resolvconf' that will automatically generate 'resolv.conf' every time you connect to the lan (as the post describes). Instead, you want to edit the file '/etc/resolvconf.conf'. Check 'man resolvconf' for more information.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.