Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using Arch Linux and I have a dynamic ip address with the use of dhcpcd. I can access websites through the google chrome but the problem is that I get 'could not resolve host' error when I run some commands on the terminal (like git clone).

I've tried pinging github.com and doing nslookup and it returns the correct ip. Any ideas?

share|improve this question
have you tried this? – domenico Apr 7 '13 at 6:01
@dcmst Cool, works fine now. You should post that as an answer. Thanks! – beef jerky Apr 7 '13 at 6:15
up vote 3 down vote accepted

Problem is that sometimes dhcpcdor other processes overwrite the content of the resolv.conf file, which is where DNS library resolver configuration is stored, inserting the DNS servers from your internet service provider, which may not work in some cases.

In case of problems it may be a good idea to change the content of resolv.conf to point to Open DNS servers (which should work better than your service provider servers):

# OpenDNS servers


# Google nameservers

and then protect the content of resolv.conf from dhcpcd adding the line nohook resolv.conf to /etc/dhcpcd.conf See the mighty Arch wiki for more details

share|improve this answer
Thanks! This was really helpful. – beef jerky Apr 8 '13 at 14:07
@beefjerky, you're welcome, maybe this was actually caused by the same DNS problem? – domenico Apr 8 '13 at 14:09
Yup, it was the same issue. I'm closing it. – beef jerky Apr 10 '13 at 13:23

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.