LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Arch (https://www.linuxquestions.org/questions/arch-29/)
-   -   Name resolution with Networkmanager (https://www.linuxquestions.org/questions/arch-29/name-resolution-with-networkmanager-4175676193/)

platypo 05-30-2020 08:52 AM

Name resolution with Networkmanager
 
I am running Archlinux-ARM Version 5.4.40-1-ARCH #1 SMP PREEMPT on a Raspberry Pi and i seem to have issues with name resolution. Sometimes it takes very long to resolve a name, sometimes it only works on a second attempt and sometimes it fails.

I recently tried to get networking mostly to be managed by NetworkManager. So the only "networking-relevant" services actively running are

iptables.service
NetworkManager.service
systemd-resolved.service
wpa-supplicant.service

I don't know how to set up dns-resolution properly. I can either edit dns-settings via 'nmtui' respectively 'nmcli', wich are currently set to 'Automatic' or i can use resolvectl. /etc/systemd/resolved.conf currently points to my gateway/isp-router and 8.8.8.8 as fallback server, along with the Options 'LLMNR', 'DNSSec' and 'DNSStubListener' set to 'no'.
Does NetworkManager rely on systemd-resolved and if so what would be the proper settings? Can nameresolution also be managed by NetworkManager only?

Edit: i'm sorry i was so caught up with the issue that i completely forgot about the archlinux.org wiki-page. It gives clear instructions on the NetworkManager-site. I'll mark this thread as solved as soon as i figured this out.

ondoho 05-31-2020 04:23 AM

Quote:

Originally Posted by platypo (Post 6128983)
iptables.service
NetworkManager.service
systemd-resolved.service
wpa-supplicant.service

Please __disable__ the last two - networkmanager should take care of everything.

Quote:

I don't know how to set up dns-resolution properly. I can either edit dns-settings via 'nmtui' respectively 'nmcli', wich are currently set to 'Automatic' or i can use resolvectl.
Once again: if you use NetworkManager, use NetworkManager.

Quote:

Does NetworkManager rely on systemd-resolved
No.

Quote:

Edit: i'm sorry i was so caught up with the issue that i completely forgot about the archlinux.org wiki-page. It gives clear instructions on the NetworkManager-site. I'll mark this thread as solved as soon as i figured this out.
aaww, cripes. 5 minutes for nothing.

platypo 06-05-2020 10:40 AM

Quote:

Originally Posted by ondoho (Post 6129235)
Please __disable__ the last two - networkmanager should take care of everything.


Once again: if you use NetworkManager, use NetworkManager.


No.


aaww, cripes. 5 minutes for nothing.

Wait a second. It says here that NetworkManager can be (or has to be?) configured to use systemd-resovled respectively dnsmasq. Doesn't that imply that the service has to be up and running (as it says in the link)?

Anyway, thanks for your time

WFV 06-14-2020 03:22 PM

You can repackage Network Manager to use openresolv. Check the Wiki regarding openresolv vs systemd-resolved.
Here is a build for using openresolv, this build does other things too like disable bluetooth and removes cloud and might not work for wifi (meant for hardwired network):
Code:

# Maintainer:
# Maintainer:
# Contributor:
# Contributor:
# Contributor:
# Contributor:

pkgbase=networkmanager
pkgname=(networkmanager libnm)
pkgver=1.24.2
pkgrel=1
pkgdesc="Network connection manager and user applications"
url="https://wiki.gnome.org/Projects/NetworkManager"
arch=(x86_64)
license=(GPL2 LGPL2.1)
_pppver=2.4.7
makedepends=(intltool dhclient iptables gobject-introspection gtk-doc "ppp=$_pppver"
            iproute2 nss polkit wpa_supplicant curl systemd libmm-glib
            libnewt libndp libteam vala perl-yaml python-gobject git vala jansson bluez-libs
            glib2-docs dnsmasq openresolv libpsl audit meson)
checkdepends=(libx11 python-dbus)
_commit=972453d7352e92f4f988e00d6f43636835a1ae91  # tags/1.24.2^0
source=("git+https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd NetworkManager
  git describe | sed 's/-dev/dev/;s/-rc/rc/;s/-/+/g'
}

prepare() {
  cd NetworkManager
}

build() {
  local meson_args=(
    # system paths
    -D dbus_conf_dir=/usr/share/dbus-1/system.d

    # platform
    -D dist_version="$pkgver-$pkgrel"
    -D session_tracking_consolekit=false
    -D suspend_resume=systemd
    -D modify_system=true
    -D polkit_agent=true
    -D selinux=false

    # features
    -D iwd=false
    -D pppd_plugin_dir=/usr/lib/pppd/$_pppver
    -D teamdctl=true
    -D bluez5_dun=false
    -D ebpf=true

    # configuration plugins
    -D config_plugins_default=keyfile

    # dhcp clients
    -D dhcpcd=no

    # miscellaneous
    -D vapi=true
    -D docs=true
    -D more_asserts=no
    -D more_logging=false
    -D qt=false
  )

  arch-meson NetworkManager build "${meson_args[@]}"
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

_pick() {
  local p="$1" f d; shift
  for f; do
    d="$srcdir/$p/${f#$pkgdir/}"
    mkdir -p "$(dirname "$d")"
    mv "$f" "$d"
    rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
  done
}

package_networkmanager() {
  depends=(libnm iproute2 polkit wpa_supplicant libmm-glib libnewt libndp libteam curl
          libpsl audit mobile-broadband-provider-info)
  optdepends=('dnsmasq: connection sharing'
              'bluez: Bluetooth support'
              'bluez-libs: bluetooth support'
              'ppp: dialup connection support'
              'modemmanager: cellular network support'
              'iwd: wpa_supplicant alternative'
              'dhclient: alternative DHCP client'
              'openresolv: alternative resolv.conf manager'
              'firewalld: Firewall support')
  backup=(etc/NetworkManager/NetworkManager.conf)
  groups=('gnome'
          'modified')

  DESTDIR="$pkgdir" meson install -C build

  # /etc/NetworkManager
  install -d "$pkgdir"/etc/NetworkManager/{conf,dnsmasq}.d
  install -dm700 "$pkgdir/etc/NetworkManager/system-connections"
  install -m644 /dev/stdin "$pkgdir/etc/NetworkManager/NetworkManager.conf" <<END
# Configuration file for NetworkManager.
# See "man 5 NetworkManager.conf" for details.
END

  # packaged configuration
  install -Dm644 /dev/stdin "$pkgdir/usr/lib/NetworkManager/conf.d/20-connectivity.conf" <<END
[connectivity]
uri=http://www.archlinux.org/check_network_status.txt
END

  shopt -s globstar

  _pick libnm "$pkgdir"/usr/include/libnm
  _pick libnm "$pkgdir"/usr/lib/girepository-1.0/NM-*
  _pick libnm "$pkgdir"/usr/lib/libnm.*
  _pick libnm "$pkgdir"/usr/lib/pkgconfig/libnm.pc
  _pick libnm "$pkgdir"/usr/share/gir-1.0/NM-*
  _pick libnm "$pkgdir"/usr/share/gtk-doc/html/libnm
  _pick libnm "$pkgdir"/usr/share/vala/vapi/libnm.*

}

package_libnm() {
  pkgdesc="NetworkManager client library"
  depends=(glib2 nss libutil-linux jansson systemd-libs)
  provides=(libnm.so)

  mv libnm/* "$pkgdir"
}

# vim:set sw=2 et:

Diff it to the one in the Arch repos to see what is actually changed

platypo 09-06-2020 05:10 AM

It took me a while to figure this out. After disabling systemd-resolved.service and removing the link /etc/resolv.conf created by systemd-resolved Networkmanager configured with dnsmasq created /etc/resolv.conf properly and name resolution works well.


All times are GMT -5. The time now is 09:01 PM.