Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've set up a Debian 7 image on my ODROID U2 a few days ago and apparently I can only resolve DNS hostnames from a root login (su, sudo). From a normal user, I can ping IP addresses and names defined in /etc/hosts just fine. When I ping a domain name, wget a file or clone a git repository it immediately gives the message 'unknown host' or 'Could not resolve host'.

The /etc/nsswitch.conf is just the Debian default file and, as the title says, I can ping/install packages/download files just fine from the root account.

What can I do to solve this problem?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

I would first check the permissions on /etc/resolv.conf and /etc/nsswitch.conf. Both of these should have read permissions for all. Test if you can read these files with cat or less. If you can't, then it is unlikely the resolver can.

You can run the resolver on its own with the command getent hosts google.com. Substitute google.com with whatever domain you want to look up.

share|improve this answer
    
Permissions for /etc/resolv.conf were apparently set wrong. Corrected it with chmod a+r /etc/resolv.conf and now it works. Thank you very much. –  m.reening Jul 7 '13 at 15:12
add comment

For Android system, there is another case which would lead to this issue: CONFIG_ANDROID_PARANOID_NETWORK was enable in kernel. Ref to this topic.

share|improve this answer
add comment

Your Answer

 
discard

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.