This question already has an answer here:

I've recently received an image of CentOS 7 and I'm having issues with resolving hosts. I'm currently on a company's VPN and all company's resources are available to me.

The problem is: nothing else is available. I've been trying to access websites like google.com and github.com and I'm getting errors like

unknown host google.com

How do I configure my resolver to fix this?

Contents of my /etc/resolv.conf:

# Generated by NetworkManager
search vbox
# NOTE: the libc resolver may not support more than 3 nameservers.
# The nameservers listed below may not be recognized.

Result of host google.com

Using domain server:

google.com has address
google.com has IPv6 address 2a00:1450:4009:803::200e
google.com mail is handled by 10 aspmx.l.google.com.
google.com mail is handled by 20 alt1.aspmx.l.google.com.
google.com mail is handled by 50 alt4.aspmx.l.google.com.
google.com mail is handled by 40 alt3.aspmx.l.google.com.
google.com mail is handled by 30 alt2.aspmx.l.google.com.

Result of dig @ google.com

; <<>> DiG 9.9.4-RedHat-9.9.4-29.el7_2.3 <<>> @ google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57064
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

; EDNS: version: 0, flags:; udp: 512
;google.com.                    IN      A

google.com.             299     IN      A

;; Query time: 25 msec
;; WHEN: Fri Dec 02 11:13:43 GMT 2016
;; MSG SIZE  rcvd: 55

marked as duplicate by Christopher, HalosGhost, Wouter Verhelst, Eric Renouf, mdpc Dec 2 '16 at 17:56

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Can you reach any of the nameserver,,, and if you are, are you sure that the one you can reach is working correct ? – Wissam Roujoulah Dec 2 '16 at 10:48
  • @WissamAl-Roujoulah Yes, I can ping them all by IP – SergeyOvchinnik Dec 2 '16 at 10:50
  • 2
    @WissamAl-Roujoulah I've tried adding as a nameserver to /etc/resolv.conf but seems like nothing changes, it still can't resolve google.com – SergeyOvchinnik Dec 2 '16 at 10:54
  • 1
    can you ping ? – Wissam Roujoulah Dec 2 '16 at 10:57
  • 1
    @WissamAl-Roujoulah I've added the outputs of both to my question – SergeyOvchinnik Dec 2 '16 at 11:18

So far I've just added line nameserver into my /etc/resolv.conf before all other nameserver lines and that fixed the issue. I'm still concerned about this change getting overwritten by NetworkManager though

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