fixing /etc/resolv.conf by undoing systemd-resolved - long live the UNIX philosophy!#!/bin/bash # jm 13dec2018 # undo-systemd-resolved.sh # fixing dns and /etc/resolv.conf # basic info/help found at: https://askubuntu.com/questions/907246/how-to-disable-systemd-resolved-in-ubuntu # run as admin #################################### echo "dns=default" >> /etc/NetworkManager/NetworkManager.conf echo "edit /etc/NetworkManager/NetworkManager.conf, move dns entry under main" read cp /etc/NetworkManager/NetworkManager.conf /etc/NetworkManager/NetworkManager.conf-ORIG-w-ERROR-2018-12-13 vi /etc/NetworkManager/NetworkManager.conf cp /etc/NetworkManager/NetworkManager.conf /etc/NetworkManager/NetworkManager.conf-corrected-2018-12-13 echo "systemctl disable systemd-resolved.service" systemctl disable systemd-resolved.service systemctl status systemd-resolved.service echo "systemctl stop systemd-resolved" systemctl stop systemd-resolved systemctl status systemd-resolved.service echo "if stopped and disabled continue" read echo "remove symlink to /etc/resolv.conf" rm /etc/resolv.conf echo "### /etc/resolv.conf created 13 Dec 2018 to undo systemd-resolved service #####" >> /etc/resolv.conf echo "### dns details #####" >> /etc/resolv.conf echo "search com net gov edu" >> /etc/resolv.conf echo "nameserver 1.1.1.1" >> /etc/resolv.conf echo "nameserver 1.0.0.1" >> /etc/resolv.conf echo "nameserver 75.75.75.75" >> /etc/resolv.conf echo "nameserver 8.8.8.8" >> /etc/resolv.conf echo "nameserver 8.8.4.4" >> /etc/resolv.conf echo "nameserver 192.168.1.1" >> /etc/resolv.conf service network-manager restart service network-manager status nslookup johnmeister.com ------------------------------------------------ ------------------------------------------------ --> chmod 755 undo-systemd-resolved.sh ------------------------------------------------ --> undo-systemd-resolved.sh edit /etc/NetworkManager/NetworkManager.conf, move dns entry under main systemctl disable systemd-resolved.service Removed /etc/systemd/system/multi-user.target.wants/systemd-resolved.service. Removed /etc/systemd/system/dbus-org.freedesktop.resolve1.service. ● systemd-resolved.service - Network Name Resolution Loaded: loaded (/lib/systemd/system/systemd-resolved.service; disabled; vendor preset: enabled) Active: active (running) since Thu 2018-12-13 13:14:52 PST; 8h 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: 672 (systemd-resolve) Status: "Processing requests..." Tasks: 1 (limit: 4915) CGroup: /system.slice/systemd-resolved.service └─672 /lib/systemd/systemd-resolved Dec 13 13:14:52 mintbox systemd[1]: Starting Network Name Resolution... Dec 13 13:14:52 mintbox systemd-resolved[672]: Positive Trust Anchors: Dec 13 13:14:52 mintbox systemd-resolved[672]: . IN DS 19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5 Dec 13 13:14:52 mintbox systemd-resolved[672]: . IN DS 20326 8 2 e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d Dec 13 13:14:52 mintbox systemd-resolved[672]: Negative trust anchors: 10.in-addr.arpa 16.172.in-addr.arpa 17.172.in-addr.arpa 18.172.in-addr.arpa 19.172 Dec 13 13:14:52 mintbox systemd-resolved[672]: Using system hostname 'mintbox'. Dec 13 13:14:52 mintbox systemd[1]: Started Network Name Resolution. systemctl stop systemd-resolved ● systemd-resolved.service - Network Name Resolution Loaded: loaded (/lib/systemd/system/systemd-resolved.service; disabled; vendor preset: enabled) Active: inactive (dead) 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 Dec 13 13:14:52 mintbox systemd[1]: Starting Network Name Resolution... Dec 13 13:14:52 mintbox systemd-resolved[672]: Positive Trust Anchors: Dec 13 13:14:52 mintbox systemd-resolved[672]: . IN DS 19036 8 2 49aac11d7b6f6446702e54a1607371607a1a41855200fd2ce1cdde32f24e8fb5 Dec 13 13:14:52 mintbox systemd-resolved[672]: . IN DS 20326 8 2 e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d Dec 13 13:14:52 mintbox systemd-resolved[672]: Negative trust anchors: 10.in-addr.arpa 16.172.in-addr.arpa 17.172.in-addr.arpa 18.172.in-addr.arpa 19.172 Dec 13 13:14:52 mintbox systemd-resolved[672]: Using system hostname 'mintbox'. Dec 13 13:14:52 mintbox systemd[1]: Started Network Name Resolution. Dec 13 22:09:33 mintbox systemd[1]: Stopping Network Name Resolution... Dec 13 22:09:33 mintbox systemd[1]: Stopped Network Name Resolution. if stopped and disabled continue remove symlink to /etc/resolv.conf ● NetworkManager.service - Network Manager Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2018-12-13 22:09:47 PST; 21ms ago Docs: man:NetworkManager(8) Main PID: 9207 (NetworkManager) Tasks: 4 (limit: 4915) CGroup: /system.slice/NetworkManager.service └─9207 /usr/sbin/NetworkManager --no-daemon Dec 13 22:09:47 mintbox NetworkManager[9207]: <info> [1544767787.0173] device added (path: /sys/devices/pci0000:00/0000:00:1c.3/0000:02:00.0/net/wlp2s0, Dec 13 22:09:47 mintbox NetworkManager[9207]: <info> [1544767787.0174] devices added (path: /sys/devices/pci0000:00/0000:00:1f.6/net/enp0s31f6, iface: e Dec 13 22:09:47 mintbox NetworkManager[9207]: <info> [1544767787.0174] device added (path: /sys/devices/pci0000:00/0000:00:1f.6/net/enp0s31f6, iface: en Dec 13 22:09:47 mintbox NetworkManager[9207]: <info> [1544767787.0174] devices added (path: /sys/devices/virtual/net/lo, iface: lo) Dec 13 22:09:47 mintbox NetworkManager[9207]: <info> [1544767787.0175] device added (path: /sys/devices/virtual/net/lo, iface: lo): no ifupdown configur Dec 13 22:09:47 mintbox NetworkManager[9207]: <info> [1544767787.0175] end _init. Dec 13 22:09:47 mintbox NetworkManager[9207]: <info> [1544767787.0175] settings: loaded plugin ifupdown: (C) 2008 Canonical Ltd. To report bugs please Dec 13 22:09:47 mintbox NetworkManager[9207]: <info> [1544767787.0176] settings: loaded plugin keyfile: (c) 2007 - 2016 Red Hat, Inc. To report bugs pl Dec 13 22:09:47 mintbox NetworkManager[9207]: <info> [1544767787.0176] (-468372736) ... get_connections. Dec 13 22:09:47 mintbox NetworkManager[9207]: <info> [1544767787.0176] (-468372736) ... get_connections (managed=false): return empty list. Dec 13 22:09:47 mintbox NetworkManager[9207]: <info> [1544767787.0349] keyfile: new connection /etc/NetworkManager/system-connections/cl5 (3138b539-7fb0 Server: 1.1.1.1 Address: 1.1.1.1#53 Non-authoritative answer: Name: johnmeister.com Address: JohnMeister.com Today's Date: |