Normal users unable to resolve dns

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux All Versions

Issue

  • Getting below error when trying to dig as a normal user :
host01.sub.test.gov% dig rhnsat.esc.gov

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.2 <<>> rhnsat.example.gov
;; global options: +cmd
;; connection timed out; no servers could be reached

Resolution

  • Verify the permissions of the /etc/resolv.conf file. Make sure that the file has read permissions.
For example:

# ls -lZ /etc/resolv.conf
-rw-r--r--. root root system_u:object_r:net_conf_t:s0  /etc/resolv.conf

Root Cause

# ls -l /etc/resolv.conf
-rw-r-----. 1 root root 381 Aug 29 21:38 /etc/resolv.conf
  • Run dig as a normal user:
$ dig redhat.com

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.2 <<>> redhat.com
;; global options: +cmd
;; connection timed out; no servers could be reached

Diagnostic Steps

  • If above information doesn't help resolve the issue, get the output of below command:
# ls -lZ /etc/resolv.conf
  • Collect sosreport

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.