1

I'm trying to remove all values from the domain search list thats generated by network manager. However I cannot get it to provide a blank list. I have tried using "ignore-auto-dns but the domain is still present. Is there any other commands that I can issue to remove all domains from the list?

I have also tried the following: nmcli con mod "System eth0" ipv4.dns-search "" and nmcli con mod "System eth0" ipv4.dns-search ".", but neither would remove search c.project.internal from /etc/resolv.conf

[root@instance-1.c:/home] $ nmcli con mod "System eth0" ipv4.ignore-auto-dns no
[root@instance-1.c:/home] $ nmcli con down "System eth0" && nmcli con up "System eth0"
Connection 'System eth0' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/1)
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/2)
[root@instance-1.c:/home] $ nmcli device show eth0
GENERAL.DEVICE:                         eth0
GENERAL.TYPE:                           ethernet
GENERAL.HWADDR:                         42:01:0A:F8:06:9A
GENERAL.MTU:                            1460
GENERAL.STATE:                          100 (connected)
GENERAL.CONNECTION:                     System eth0
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/2
WIRED-PROPERTIES.CARRIER:               on
IP4.ADDRESS[1]:                         10.248.6.154/32
IP4.GATEWAY:                            10.248.0.1
IP4.ROUTE[1]:                           dst = 10.248.0.1/32, nh = 0.0.0.0, mt = 100
IP4.ROUTE[2]:                           dst = 0.0.0.0/0, nh = 10.248.0.1, mt = 100
IP4.ROUTE[3]:                           dst = 10.248.6.154/32, nh = 0.0.0.0, mt = 100
IP4.DNS[1]:                             10.248.253.253
IP4.DNS[2]:                             10.248.254.254
IP4.DNS[3]:                             169.254.169.254
IP4.DOMAIN[1]:                          c.project.internal
IP6.ADDRESS[1]:                         fe80::4001:aff:fef8:69a/64
IP6.GATEWAY:                            --
IP6.ROUTE[1]:                           dst = fe80::/64, nh = ::, mt = 100
IP6.ROUTE[2]:                           dst = ff00::/8, nh = ::, mt = 256, table=255
[root@instance-1.c:/home] $ cat /etc/resolv.conf
# Generated by NetworkManager
search c.project.internal google.internal
nameserver 10.248.253.253
nameserver 10.248.254.254
nameserver 169.254.169.254
[root@instance-1.c:/home] $ nmcli con mod "System eth0" ipv4.ignore-auto-dns yes
[root@instance-1.c:/home] $ nmcli con down "System eth0" && nmcli con up "System eth0"
Connection 'System eth0' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/2)
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/3)
[root@instance-1.c:/home] $ nmcli device show eth0
GENERAL.DEVICE:                         eth0
GENERAL.TYPE:                           ethernet
GENERAL.HWADDR:                         42:01:0A:F8:06:9A
GENERAL.MTU:                            1460
GENERAL.STATE:                          100 (connected)
GENERAL.CONNECTION:                     System eth0
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/3
WIRED-PROPERTIES.CARRIER:               on
IP4.ADDRESS[1]:                         10.248.6.154/32
IP4.GATEWAY:                            10.248.0.1
IP4.ROUTE[1]:                           dst = 10.248.0.1/32, nh = 0.0.0.0, mt = 100
IP4.ROUTE[2]:                           dst = 0.0.0.0/0, nh = 10.248.0.1, mt = 100
IP4.ROUTE[3]:                           dst = 10.248.6.154/32, nh = 0.0.0.0, mt = 100
IP4.DNS[1]:                             10.248.253.253
IP4.DNS[2]:                             10.248.254.254
IP6.ADDRESS[1]:                         fe80::4001:aff:fef8:69a/64
IP6.GATEWAY:                            --
IP6.ROUTE[1]:                           dst = fe80::/64, nh = ::, mt = 100
IP6.ROUTE[2]:                           dst = ff00::/8, nh = ::, mt = 256, table=255
[root@instance-1.c:/home] $ cat /etc/resolv.conf
# Generated by NetworkManager
search c.project.internal
nameserver 10.248.253.253
nameserver 10.248.254.254

The above example shows that ignore-auto-dns is in fact ignoring the domain passd from DHCP, but networkmanager is still getting a domain from somewhere.

  • Is your goal to remove any traces of c.project.internal domain from /etc/resolv.conf ? You need some script to do this ? I'm not sure what the question is here... – W_B Jul 1 at 8:47
  • what gives NetworkManager --print-config? Does it indicate that DNS settings are set globally? Then see gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/… for how to unset it. – thaller yesterday

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.