Question

Unable to resolve DNS from with a droplet created via terraform

I’ve created a droplet and firewall config (using terraform) from the docker-18-04 and docker-20-04 images and I am unable to perform any DNS resolution from within these hosts. I’ve opened 53/tcp and 53/udp outgoing in the DO firewall, and tried opening them using UFW on the host as well just in case, with no luck. What else would interfere with DNS resolution from within a newly created droplet?

Just in case it helps, this is what the relevant part of the config looks like in terraform:

resource "digitalocean_droplet" "cafe" {
  image = "docker-20-04"
  name = "cafe"
  region = "sfo2"
  size = "s-2vcpu-4gb"
  private_networking = false
  monitoring = true
  ssh_keys = [
    digitalocean_ssh_key.hal.fingerprint
  ]
}

resource "digitalocean_firewall" "cafe" {
  name = "cafe"
  droplet_ids = [ digitalocean_droplet.cafe.id ]
  inbound_rule {
      protocol = "tcp"
      port_range = "22"
      source_addresses = var.vpn_source_addrs
  }
  inbound_rule {
      protocol = "tcp"
      port_range = "443"
  }
  inbound_rule {
    protocol = "icmp"
  }
  outbound_rule {
    protocol = "tcp"
    port_range = "53"
  }
  outbound_rule {
    protocol = "udp"
    port_range = "53"
  }
  outbound_rule {
    protocol = "icmp"
  }
}



Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

It’s actually a problem with all outgoing traffic, I’ve rewritten the question: https://www.digitalocean.com/community/questions/droplets-created-with-terraform-have-no-outgoing-network-access

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel