[NextCloudPi] Set static IP and fix dns resolving in NextCloudPi v0.56.15

nmcli connection add con-name “static” ifname eth0 autoconnect yes type ethernet ip4 10.161.115.133/26 gw4 10.161.115.130
nmcli connection modify “static” ipv4.dns 10.161.115.130
nmcli connection modify “static” +ipv4.dns 8.8.8.8
nmcli connection up static

nslookup ya.ru
;; connection timed out; no servers could be reached

???

nslookup ya.ru 10.161.115.130
Server: 10.161.115.130
Address: 10.161.115.130#53

Non-authoritative answer:
Name: ya.ru
Address: 87.250.250.242

cat /etc/resolv.conf

Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)

DO NOT EDIT THIS FILE BY HAND – YOUR CHANGES WILL BE OVERWRITTEN

???

cat /etc/NetworkManager/NetworkManager.conf

[main]
dns=none
plugins=ifupdown,keyfile

[ifupdown]
managed=true

WTF!!!

nano /etc/NetworkManager/NetworkManager.conf

cat /etc/NetworkManager/NetworkManager.conf

[main]
#dns=none
plugins=ifupdown,keyfile

[ifupdown]
managed=true

systemctl restart NetworkManager

cat /etc/resolv.conf

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 10.161.115.130
nameserver 8.8.8.8

ncp, please do not add “dns=none” in /etc/NetworkManager/NetworkManager.conf before enable dnsmasq
After enable dnsmasq “dns=dnsmasq” in /etc/NetworkManager/NetworkManager.conf work well.