View Issue Details

IDProjectCategoryView StatusLast Update
0007162Rocky-Linux-9NetworkManagerpublic2024-06-14 01:43
Reportermi smith Assigned ToLouis Abel  
PrioritynormalSeveritymajorReproducibilityalways
Status needinfoResolutionopen 
Summary0007162: When I call hostnamectl set-hostname to set the host name, my nameserver will always be modified as the current gateway, and if
DescriptionWhen I call hostnamectl set-hostname to set the host name, my nameserver will always be modified as the current gateway, and if the gateway is not the standard x.x.x.x, the nameserver will not be set, causing networking failure.
Steps To ReproduceThe first step is to modify the nameserver to a non-gateway
Step 2 hostnamectl set-hostname a.com
Step 3 systemctl restart NetworkManager
Step 4: Check /etc/resolve.com and you will find that the nameserver has become the default gateway IP.
TagsNo tags attached.

Activities

mi smith

mi smith

2024-06-13 15:05

reporter   ~0007492

Rocky Linux 8.7 also has this problem
Louis Abel

Louis Abel

2024-06-13 16:06

administrator   ~0007493

This sounds completely environmental and not a bug in Rocky Linux. In your example, you are setting a system to a top level domain (a.com) and not an FQDN (host.a.com). You are also saying that doing this causes /etc/resolv.conf to exhibit strange data (your gateway). This is not reproducible on any of my systems.

Setting to needinfo for now.
mi smith

mi smith

2024-06-14 01:33

reporter   ~0007494

The system information is as follows
[root@mshome ~]# hostnamectl
   Static hostname: mshome.com
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 26196a7ff6f34b23906f7778c217a515
           Boot ID: bb4cfefa028f481b9b876e416ca5336d
    Virtualization: microsoft
  Operating System: Rocky Linux 8.7 (Green Obsidian)
       CPE OS Name: cpe:/o:rocky:rocky:8:GA
            Kernel: Linux 4.18.0-425.19.2.el8_7.x86_64
      Architecture: x86-64

The steps are as follows
[root@mshome ~]# cat /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
[root@mshome ~]# hostnamectl set-hostname 1newhost.com
[root@mshome ~]# cat /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
[root@mshome ~]# systemctl restart NetworkManager
[root@mshome ~]# cat /etc/resolv.conf
# Generated by NetworkManager
search mshome.net com
nameserver 192.168.80.1

I have 2 rocky Linux 9.4 and one rocky Linux 8.7 here can reproduce the issue 100%.
Louis Abel

Louis Abel

2024-06-14 01:43

administrator   ~0007495

Again, this appears to be environmental. This is not reproducible on my end.

[root@localhost ~]# ip a s enp0s3
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 08:00:27:5f:73:aa brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic noprefixroute enp0s3
       valid_lft 86277sec preferred_lft 86277sec
    inet6 fe80::6eba:d934:6c1c:96a7/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
[root@localhost ~]# hostnamectl
   Static hostname: (unset)
Transient hostname: localhost
         Icon name: computer-vm
           Chassis: vm 🖴
        Machine ID: 398fd1d82e9e46388c3f049cb6fa45ab
           Boot ID: 13f65dc24fd04846ad87461a67c80698
    Virtualization: oracle
  Operating System: Rocky Linux 9.4 (Blue Onyx)
       CPE OS Name: cpe:/o:rocky:rocky:9::baseos
            Kernel: Linux 5.14.0-427.16.1.el9_4.x86_64
      Architecture: x86-64

[root@localhost ~]# hostnamectl set-hostname somehost.com
[root@localhost ~]# hostname
somehost.com
[root@localhost ~]# hostnamectl
 Static hostname: somehost.com
       Icon name: computer-vm
         Chassis: vm 🖴
      Machine ID: 398fd1d82e9e46388c3f049cb6fa45ab
         Boot ID: 13f65dc24fd04846ad87461a67c80698
  Virtualization: oracle
Operating System: Rocky Linux 9.4 (Blue Onyx)
     CPE OS Name: cpe:/o:rocky:rocky:9::baseos
          Kernel: Linux 5.14.0-427.16.1.el9_4.x86_64
    Architecture: x86-64

[root@localhost ~]# cat /etc/resolv.conf
# Generated by NetworkManager
search angelsofclockwork.net com
nameserver 10.100.0.1
nameserver 10.100.0.231
[root@localhost ~]# systemctl restart NetworkManager
[root@localhost ~]# cat /etc/resolv.conf
# Generated by NetworkManager
search angelsofclockwork.net com
nameserver 10.100.0.1
nameserver 10.100.0.231

---

Notice how in my output, my /etc/resolv.conf has stayed the same. This is why I'm saying this is not reproducible and your issue is environmental. You've not shown enough information to show that it isn't. Have you verified your nmcli connection show output on your interface(s)?

Issue History

Date Modified Username Field Change
2024-06-13 15:03 mi smith New Issue
2024-06-13 15:05 mi smith Note Added: 0007492
2024-06-13 16:06 Louis Abel Assigned To => Louis Abel
2024-06-13 16:06 Louis Abel Status new => needinfo
2024-06-13 16:06 Louis Abel Note Added: 0007493
2024-06-14 01:33 mi smith Note Added: 0007494
2024-06-14 01:43 Louis Abel Note Added: 0007495