Bug 1950770 - Nameserver not configured
Summary: Nameserver not configured
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: cloud-init
Version: 34
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Eduardo Otubo
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-04-18 14:44 UTC by Alessio
Modified: 2021-09-10 09:47 UTC (History)
11 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2021-09-10 09:47:42 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Fedora Pagure fedora-server issue 10 0 None None None 2021-04-27 16:16:25 UTC

Description Alessio 2021-04-18 14:44:32 UTC
Fedora-Cloud-Base-34-20210418.n.0.x86_64.qcow2

Image deployed on a Proxmox environment.

Static IP, SSH Key, user password and hostname are configured correctly. Nameserver not configured.

$ resolvectl dns
Global:
Link 2 (eth0):


From the logs: 
2021-04-18 14:17:01,196 - stages.py[INFO]: Applying network configuration from ds bringup=False: {'version': 1, 'config': [{'type': 'physical', 'name': 'eth0', 'mac_address': '8a:3c:1b:d2:e9:ca', 'subnets': [{'type': 'static', 'address': '192.168.1.129', 'netmask': '255.255.255.0', 'gateway': '192.168.1.1'}]}, {'type': 'nameserver', 'address': ['192.168.1.2'], 'search': ['mylan.test']}]}

So the cloud-init data seems to be read correctly.

Comment 1 Dusty Mabe 2021-04-20 15:43:41 UTC
Hey Eduardo, Can you take a look at this. Looks like a legitimate bug.

Comment 2 Daniel Scime 2021-04-27 04:33:46 UTC
Can confirm that I'm seeing the same behavior from Fedora 33 5.11.15-200.fc33.x86_64 also running on Proxmox.

Just as reported by Alessio, `resolvectl dns` shows no configured name servers, and the cloud-init log shows it's reading the configured nameservers and local search domain.

Comment 3 Eduardo Otubo 2021-05-11 08:34:38 UTC
Alessio, can you attach the entire cloud-init log?

Comment 4 Michael Catanzaro 2021-05-11 13:33:43 UTC
cloud-init currently doesn't have any code for configuring systemd-resolved, so you shouldn't need any debug log IMO. There's not really anything to investigate, right? To solve this bug, cloud-init should create /etc/systemd/system.conf.d/ with a drop-in file that looks like this:

[Resolve]
DNS=1.1.1.1 1.0.0.1 2606:4700:4700::1111 2606:4700:4700::1001

Of course replace the Cloudflare IP addresses with the desired ones.

Comment 5 Eduardo Otubo 2021-05-11 13:44:50 UTC
(In reply to Michael Catanzaro from comment #4)
> cloud-init currently doesn't have any code for configuring systemd-resolved,
> so you shouldn't need any debug log IMO. There's not really anything to
> investigate, right? 

There's no mention about systemd-resolved on the initial description of the bug.

> To solve this bug, cloud-init should create
> /etc/systemd/system.conf.d/ with a drop-in file that looks like this:
> 
> [Resolve]
> DNS=1.1.1.1 1.0.0.1 2606:4700:4700::1111 2606:4700:4700::1001
> 
> Of course replace the Cloudflare IP addresses with the desired ones.

Indeed cloud-init don't seem to support systemd-resolved at the moment.
I'll address this issue on their launchpad as well.

Comment 6 Eduardo Otubo 2021-09-08 11:22:01 UTC
The latest cloud-init rebase for Fedora Rawhide includes a fix that might solve this issue:

commit 35aa9db6f8e2ba05d366776c0e8d97f52217e930
Author: sshedi <53473811+sshedi.github.com>
Date:   Fri Jun 18 22:23:44 2021 +0530

    Add support for VMware PhotonOS (#909)
    
    Also added a new (currently experimental) systemd-networkd renderer,
    and includes a small refactor to cc_resolv_conf.py to support the
    resolved.conf used by systemd-resolved.

Can you please test it?

Comment 7 Alessio 2021-09-08 11:55:31 UTC
Using Fedora-Cloud-Base-Rawhide-20210908.n.0.x86_64, deployed on a Proxmox environment, I can confirm that DNS are correctly configured.


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