systemd-resolved: manually dhclient ethx,dns nameserver in the /etc/resolve.conf will be written duplicate

Asked by Liyuan

systemd version the issue has been seen with
249

Used distribution
ubuntu22

Linux kernel version used
5.15.0-72-generic

CPU architectures issue was seen on
None

Component
systemd-resolved

Unexpected behaviour you saw

https://github.com/systemd/systemd/issues/28055

not this problem when I was on ubuntu20. The version of systemd is 245

this problem when I was on ubuntu22. The systemd version is 249

I compared the codes and suspected that v248 commit cbf23f3
caused by

I saw this issuse about netplan on ubuntu
https://superuser.com/questions/1721017/remove-redundant-dns-servers-in-ubuntu-22-04

But it doesn't work for dhclient (why I use dhclient, because I found it out of curiosity)

Steps to reproduce the problem
1: Start a virtual machine on the cloud
2: Insert multiple network cards (auxiliary network card)
3: Manually use dhclient to start ethx (except eth0) dhclient -v -d eth1
4: View /etc/resolve.conf

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu systemd Edit question
Assignee:
No assignee Edit question
Solved by:
actionparsnip
Solved:
Last query:
Last reply:
Revision history for this message
Best actionparsnip (andrew-woodhead666) said :
#1

I suggest you report a bug

Revision history for this message
Liyuan (zhangrocker) said :
#2

Get,Thanks

Revision history for this message
Liyuan (zhangrocker) said :
#3

Thanks actionparsnip, that solved my question.

Revision history for this message
Liyuan (zhangrocker) said :
#4