Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1487084

Summary: nmtui does not respect order of nameservers
Product: Red Hat Enterprise Linux 7 Reporter: Tom Stocker <neo>
Component: NetworkManagerAssignee: Beniamino Galvani <bgalvani>
Status: CLOSED NOTABUG QA Contact: Desktop QE <desktop-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.4CC: atragler, bgalvani, fgiudici, lrintel, neo, rkhan, sukulkar, thaller
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-09-01 15:15:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
screenshot of nmtui config
none
[PATCH] tui: add ignore-auto-dns property to IPv4 and IPv6 pages none

Description Tom Stocker 2017-08-31 08:39:50 UTC
Created attachment 1320508 [details]
screenshot of nmtui config

Description of problem:

nmtui does not respect order of nameservers (orders it by numers)

Version-Release number of selected component (if applicable):

NetworkManager-tui-1.8.0-9.el7.x86_64

How reproducible:

change DNS by using nmtui

Steps to Reproduce:
1. install latest RHEL7.4

[root@hostname ~]# cat /etc/resolv.conf
# Generated by NetworkManager
search acme.com
nameserver 10.64.252.32
nameserver 10.64.255.35
-> got correct nameservers by DHCP.

use nmtui to set nameservers statically (screenshot attached)

[root@hostname ~]# echo "search abc.xyz.com" > /etc/resolv.conf
[root@hostname ~]# echo "nameserver 127.0.0.1" >> /etc/resolv.conf
[root@hostname ~]# cat /etc/resolv.conf
search abc.xyz.com
nameserver 127.0.0.1
[root@hostname ~]# systemctl restart network
[root@hostname ~]# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 10.64.252.32
nameserver 10.64.255.35
nameserver 10.64.255.86

Actual results:

[root@hostname ~]# systemctl restart network
[root@hostname ~]# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 10.64.252.32
nameserver 10.64.255.35
nameserver 10.64.255.86

Expected results:

[root@hostname ~]# systemctl restart network
[root@hostname ~]# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 10.64.255.86
nameserver 10.64.252.32
nameserver 10.64.255.35

Additional info:

Comment 2 Beniamino Galvani 2017-08-31 12:58:07 UTC
Adding static nameservers to a DHCP connection means that the static
DNS are used *in addition* to the ones returned by DHCP. Since DHCP
returns:

  10.64.252.32
  10.64.255.35

and the manual DNS are:

  10.64.255.86
  10.64.252.32
  10.64.255.35

the content of resolv.conf is:

  10.64.252.32 (from DHCP)
  10.64.255.35 (from DHCP)
  10.64.255.86 (static)

To ignore DNS servers obtained from DHCP users can set the
ipv4.ignore-auto-dns property. At the moment this is only possible
using nmcli:

 nmcli connection modify enp0s3 ipv4.ignore-auto-dns yes
 nmcli connection up enp0s3

Probably it's a good idea to add that option to nmtui as well.

Comment 3 Tom Stocker 2017-08-31 13:06:50 UTC
Ah, thanks for the clarification. Of course restarting NM issues a new DHCP request, I've missed that fact.

+1 for adding the option to nmtui though.

Comment 4 Beniamino Galvani 2017-09-01 14:21:49 UTC
Created attachment 1320979 [details]
[PATCH] tui: add ignore-auto-dns property to IPv4 and IPv6 pages

Comment 5 Thomas Haller 2017-09-01 14:57:39 UTC
(In reply to Beniamino Galvani from comment #4)
> Created attachment 1320979 [details]
> [PATCH] tui: add ignore-auto-dns property to IPv4 and IPv6 pages

lgtm

Comment 6 Beniamino Galvani 2017-09-01 15:15:25 UTC
(In reply to Tom Stocker from comment #3)
> Ah, thanks for the clarification. Of course restarting NM issues a new DHCP
> request, I've missed that fact.

I'm closing this, please reopen if needed.


> +1 for adding the option to nmtui though.

Added:

https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=7246c87f0fd279332e577a757fa5c954094e8f41