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:

Simply Linux: Basics  Full Size Jeep Buyer's Guide Using BASH on Windows 10
Practical Suggestions for Microsoft Windows
Linux Tackles Microsoft
Video Course:
The Art of Linux System Administration, and a
Study Guide for the LPIC-2 Certification Exams.

-- O'Reilly Media author info
FULL SIZE JEEP

Buyer's Guide

SJ Jeeps

"Jeep is America's
only real sports car."
-Enzo Ferrari


Mercedes, VW, and other Diesels
Nikon cameras
general tech info
AMSOIL product guide,
or, AMSOIL web, or 1-800-956-5695,
use customer #283461

Amsoil dealer since 1983

purchase AMSOIL and have it
installed locally in WA at:

- Northland Diesel 360.676.1970 - Bellingham
- Midway Auto 360.668.7111 - Clearview/Snohomish
- Fleet Services 425.355.4440 - Everett