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 1984277 - [RFE] Allow user to change DNS search only and preserving existing DNS nameservers
Summary: [RFE] Allow user to change DNS search only and preserving existing DNS namese...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: nmstate
Version: 8.4
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: beta
: ---
Assignee: Gris Ge
QA Contact: Mingyu Shi
Mayur Patil
URL:
Whiteboard:
Depends On:
Blocks: 1983171 2006093
TreeView+ depends on / blocked
 
Reported: 2021-07-21 06:45 UTC by Ales Musil
Modified: 2023-10-15 09:43 UTC (History)
9 users (show)

Fixed In Version: nmstate-1.2.1-0.1.alpha1.el8
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-10 13:34:46 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github nmstate nmstate pull 1777 0 None open dns: Allow user to change dns search or search only 2022-01-04 07:40:33 UTC
Red Hat Issue Tracker NMT-955 0 None None None 2023-10-15 09:43:49 UTC
Red Hat Product Errata RHEA-2022:1772 0 None None None 2022-05-10 13:35:02 UTC

Description Ales Musil 2021-07-21 06:45:40 UTC
Description of problem:
Allow user to define static DNS search in a simple apply e.g.:
---
dns-resolver:
  config:
    search:
    - server1
    - server2

It would make sense if this is possible only for default route nics with static IP or auto-dns false.

Comment 2 Gris Ge 2021-09-18 08:45:37 UTC
Hi Ales,

What is nmstate expected to do with name servers for this desire state?

Comment 3 Ales Musil 2021-09-30 09:10:49 UTC
Hi Gris,

the specified search should be added to resolv.conf.

Thanks,
Ales

Comment 4 Gris Ge 2021-10-12 06:31:29 UTC
Hi Ales,

With above desire state, nmstate might think you want EMPTY nameserver and only want to search config which seems incorrect to me.

Are you requesting nmstate to set only the dns server and use nameserver from DHCP?

Comment 5 Ales Musil 2021-10-12 09:00:10 UTC
(In reply to Gris Ge from comment #4)
> Hi Ales,

Hi,
> 
> With above desire state, nmstate might think you want EMPTY nameserver and
> only want to search config which seems incorrect to me.

It would be better if nmstate could apply only search if nameservers are empty but it depends how 
complex it would be to implement. 

> 
> Are you requesting nmstate to set only the dns server and use nameserver
> from DHCP?

This configuration to me makes sense only for static ip or dhcp with "auto-dns=false".

Comment 6 Gris Ge 2021-10-18 06:33:11 UTC
After check with Ales, confirmed customer is expecting to change DNS server only in desire state with existing DNS nameserver persevered.

To test this feature:
 * Applied a state with static DNS setting.
 * Apply below state:

---
dns-resolver:
  config:
    search:
      - example.com
      - example.org

Comment 9 Mingyu Shi 2022-01-24 09:19:42 UTC
Hi Gris,

I understand I can change `search` and don't touch `server`.
But if there is **NO ANY** configured dns server, I cannot configure `search` alone, it that right? For example:

# there is nothing in dns-resolver.config in the beginning:
[17:01:45@dell-per740-80 ~/repo-nmstate/libnmstate]0# nmstatectl show | head -10
---
dns-resolver:
  config: {}
  running:
    search:
    - rhts.eng.pek2.redhat.com
    server:
    - 10.73.2.107
    - 10.73.2.108
    - 10.66.127.10

# then I try adding `search` WITHOUT `server`
echo "
dns-resolver:
  config:
    search:
    - usersys.redhat.com
routes:
  config:
  - destination: 0.0.0.0/0
    metric: 1000
    next-hop-address: 192.168.199.254
    next-hop-interface: veth0
    table-id: 199
interfaces:
- name: veth0
  type: veth
  state: up
  ipv4:
    enabled: true
    address:
    - ip: 192.168.199.1
      prefix-length: 24
  veth:
    peer: veth0_ep
" | nmstatectl apply -

it fails.

Comment 10 Mingyu Shi 2022-01-24 10:40:25 UTC
(In reply to Mingyu Shi from comment #9)
> Hi Gris,
> 
> I understand I can change `search` and don't touch `server`.
> But if there is **NO ANY** configured dns server, I cannot configure
> `search` alone, it that right? For example:
> 
> # there is nothing in dns-resolver.config in the beginning:
> [17:01:45@dell-per740-80 ~/repo-nmstate/libnmstate]0# nmstatectl show | head
> -10
> ---
> dns-resolver:
>   config: {}
>   running:
>     search:
>     - rhts.eng.pek2.redhat.com
>     server:
>     - 10.73.2.107
>     - 10.73.2.108
>     - 10.66.127.10
> 
> # then I try adding `search` WITHOUT `server`
> echo "
> dns-resolver:
>   config:
>     search:
>     - usersys.redhat.com
> routes:
>   config:
>   - destination: 0.0.0.0/0
>     metric: 1000
>     next-hop-address: 192.168.199.254
>     next-hop-interface: veth0
>     table-id: 199
> interfaces:
> - name: veth0
>   type: veth
>   state: up
>   ipv4:
>     enabled: true
>     address:
>     - ip: 192.168.199.1
>       prefix-length: 24
>   veth:
>     peer: veth0_ep
> " | nmstatectl apply -
> 
> it fails.

Discussed with Fernando, let me retell: 
the current situation meets the tile "change DNS search only and preserving existing DNS nameservers" (the `servers` exists).
The current problem is that I cannot add `search` when there is NO any `servers`.
I'm marking the current bug as verified and opening a new BZ for tracking the issue

Comment 11 Mingyu Shi 2022-01-24 11:00:36 UTC
Verified with versions:
nmstate-1.2.1-0.1.alpha1.el8.x86_64
nispor-1.2.3-1.el8.x86_64
NetworkManager-1.36.0-0.4.el8.x86_64

Comment 16 errata-xmlrpc 2022-05-10 13:34:46 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (nmstate bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2022:1772


Note You need to log in before you can comment on or make changes to this bug.