0

my google cloud VM is not able to resolve external URLs , please see the screenshot.

enter image description here any help in addressing this issue , greatly appreciated

As recommended attaching screenshot of resolv.conf enter image description here

After restarting systemd-resolved getting below error

systemd-resolved.service - Network Name Resolution
   Loaded: loaded (/lib/systemd/system/systemd-resolved.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2020-02-13 10:25:59 UTC; 41s ago
     Docs: man:systemd-resolved.service(8)
           https://www.freedesktop.org/wiki/Software/systemd/resolved
           https://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers
           https://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients
 Main PID: 10316 (systemd-resolve)
   Status: "Processing requests..."
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/systemd-resolved.service
           └─10316 /lib/systemd/systemd-resolved

Feb 13 10:26:38 dev.seconize.co systemd-resolved[10316]: Failed to open /etc/hosts: Permission denied
Feb 13 10:26:38 dev.seconize.co systemd-resolved[10316]: Failed to start query: Permission denied
Feb 13 10:26:40 dev.seconize.co systemd-resolved[10316]: Failed to open /etc/hosts: Permission denied
Feb 13 10:26:40 dev.seconize.co systemd-resolved[10316]: Failed to start query: Permission denied
Feb 13 10:26:40 dev.seconize.co systemd-resolved[10316]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with
Feb 13 10:26:40 dev.seconize.co systemd-resolved[10316]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with
Feb 13 10:26:40 dev.seconize.co systemd-resolved[10316]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with
Feb 13 10:26:40 dev.seconize.co systemd-resolved[10316]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with
Feb 13 10:26:40 dev.seconize.co systemd-resolved[10316]: Server returned error NXDOMAIN, mitigating potential DNS violation DVE-2018-0001, retrying transaction with
Feb 13 10:26:40 dev.seconize.co systemd-resolved[10316]: Server returned error NXDOMAIN, mit
sashank
  • 101
  • 4
  • Looks like your OS thinks that DNS at 127.0.0.1. Did you change DNS servers for your VM? Please run `cat /etc/resolv.conf` and update your question with output. – Serhii Rohoza Feb 13 '20 at 08:36
  • By default DNS setting for your VM managed by Google Cloud and no changes needed. – Serhii Rohoza Feb 13 '20 at 08:49
  • added the screenshot , yeah we did not touch any of that – sashank Feb 13 '20 at 09:51
  • Thanks! Please run `sudo systemctl restart systemd-resolved`, then `sudo systemctl status systemd-resolved` and after that check `cat /etc/resolv.conf` again. In addition, provide output of `cat /etc/systemd/resolved.conf `. – Serhii Rohoza Feb 13 '20 at 10:21
  • Do you have admin permissions? Please provide output of `cat /etc/systemd/resolved.conf` and `cat /etc/hosts`. – Serhii Rohoza Feb 13 '20 at 11:19
  • yeah its permissions issue , resolved it now , thanks ! not sure how to close the quesiton – sashank Feb 15 '20 at 13:53
  • Please let me know if restart of `systemd-resolved` service with admin privileges helped you to solve this issue. – Serhii Rohoza Feb 17 '20 at 07:59
  • 1
    /etc/hosts permissions were messed up some how , so had to fix and then restart systemd-resolved to bring it back – sashank Feb 17 '20 at 17:14
  • Thanks! Could you post an answer and then accept it? It'll be useful for community. – Serhii Rohoza Feb 17 '20 at 17:37

1 Answers1

0

As it was explained in comments by @sashank the cause of this issue was wrong permissions on file /etc/hosts. When permissions were fixed restart of systemd-resolved service finally solved the issue.

Serhii Rohoza
  • 1,424
  • 2
  • 5
  • 15