Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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'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
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 Substitute 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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .