← Back to team overview

cloud-init team mailing list archive

Re: DNS name resolution not working


> On May 18, 2022, at 14:49, Larry Menard <larry.menard@xxxxxxxxx> wrote:
> Hello.
> I've installed Amazon Linux 2 in a VMware Workstation VM as described in https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/amazon-linux-2-virtual-machine.html.
> After starting up the VM I'm able to login as ec2-user, but the system is unable to resolve any DNS names.  There is absolutely nothing in "/etc/resolv.conf".

I don’t think you’re doing cloud-init wrong. If I had to guess looking at the AWS doc you linked, the network config they tell you to use is wrong. Generally speaking, the network should be set to come up and use DHCP, not a static address, which may or may not conflict with an existing IP assignment, in a subnet that may or may not match your LAN.

Most likely, your VM has no network connectivity at all and the DNS issues you’re seeing are a symptom of that.

I would suggest seeing if you can at least ping the gateway address, but even that looks dodgy. While it can be anything, conventionally it’s x.x.x.1, not .254.

Assuming the VM’s NIC is already configured to bridge, you should be able to adjust those values to match your actual network, selecting an address for your VM that’s not being used. Better is to set it to use DHCP. If the NIC is not bridged, but rather is the default and is set up to NAT, you’ll have to make the VM use DHCP.


Follow ups