|
| 1 | +--- |
| 2 | +meta: |
| 3 | + title: Understanding Scaleway DNS for VPC and Private Networks |
| 4 | + description: Learn more about how internal DNS works within the Scaleway ecosystem, and how to ensure your infrastructure is using DNS efficiently. |
| 5 | +content: |
| 6 | + h1: Understanding Scaleway DNS for VPC and Private Networks |
| 7 | + paragraph: Learn more about how internal DNS works within the Scaleway ecosystem, and how to ensure your infrastructure is using DNS efficiently. |
| 8 | +tags: vpc private-network dns dns-server dns-resolution hostname |
| 9 | +dates: |
| 10 | + validation: 2024-12-31 |
| 11 | + posted: 2024-12-31 |
| 12 | +categories: |
| 13 | + - network |
| 14 | +--- |
| 15 | + |
| 16 | +Scaleway VPC and Private Networks integrate managed DNS, for the effective resolution of hostnames to IP addresses. Read on to find out more. |
| 17 | + |
| 18 | +## What is DNS? |
| 19 | + |
| 20 | +The **D**omain **N**ame **S**ystem (DNS) is a naming system for devices connected to the internet or any network. Most prominently, DNS servers translate text-based domain names (e.g. www.scaleway.com) to numerical IP addresses (e.g. 51.158.66.220). This allows traffic to find its destination by resolving a human-readable text-based name, to the numerical IP addresses used by networks and servers. |
| 21 | + |
| 22 | +## Scaleway DNS overview |
| 23 | + |
| 24 | +Scaleway Private Networks benefit from managed internal DNS. This allows the resolution of resources' **hostnames** on the Private Network, into their private IP addresses. This managed DNS service is automatically exposed in each Private Network and no user configuration is required. |
| 25 | + |
| 26 | +<Message type="note"> |
| 27 | +When a Private Network is attached to a [legacy Public Gateway](/network/public-gateways/concepts/#ipam), the gateway’s DNS takes priority over that of the Private Network. |
| 28 | +</Message> |
| 29 | + |
| 30 | +## Hostname format |
| 31 | + |
| 32 | +A resource's hostname is equivalent to the name you gave the resource when creating it. The full format for internal addressing is `<hostname>.<private-network-name>.internal`. For example, if you have an Instance with the name `instance123` attached to a Private Network named `prodpn`, its address on that network is `instance123.prodpn.internal`. |
| 33 | + |
| 34 | +<Message type="tip"> |
| 35 | +- If you update the resource's name after creating it, and thus its hostname changes, it will not be automatically updated on our DNS records unless you detach and reattach the resource to the Private Network. <br/><br/> |
| 36 | +- If you created the resource via the API, and it has dots in its name, these dots should be replaced by dashes for the purposes of DNS resolution (`my.instance` --> `my-instance`). We generally recommend avoiding using dots in your resource names to avoid issues.<br/><br/> |
| 37 | +</Message> |
| 38 | + |
| 39 | +## DNS resolution details |
| 40 | + |
| 41 | +The managed DNS resolver service is exposed on each Private Network through the following IP addresses: |
| 42 | + |
| 43 | +- IPv4: `169.254.169.254` |
| 44 | +- IPv6: `fe80::200:22ff:fe05:ca1e` |
| 45 | + |
| 46 | +The service resolves both regular public records, as well as internal VPC records. |
| 47 | + |
| 48 | +<Message type="tip"> |
| 49 | +The `.internal` at the end of internal addresses is important in enabling the resolver to distinguish between internal and external/public DNS. For this reason, you should always add `.internal` when addressing resources within your VPC. |
| 50 | +</Message> |
| 51 | + |
| 52 | +The DNS service resolves the following formats: |
| 53 | + |
| 54 | +``` |
| 55 | +<resource_name>.<private-network_name>.internal |
| 56 | +<resource_name>.<private-network_uuid>.internal |
| 57 | +<resource_uuid>.<private-network_uuid>.internal |
| 58 | +``` |
| 59 | + |
| 60 | +<Message type="tip"> |
| 61 | +The `resource_uuid` does not generally correspond to the ID of the principal resource (e.g. Instance, Elastic Metal server, Public Gateway), but rather to the ID of the sub-resource that facilitates the attachment to the Private Network. For example: |
| 62 | +- Instances: `resource_uuid` corresponds to the [Private NIC](https://www.scaleway.com/en/developers/api/instance/#path-private-nics-list-all-private-nics) ID |
| 63 | +- Elastic Metal: `resource_uuid` corresponds to the ID of the [Server-to-Private Network mapping](https://www.scaleway.com/en/developers/api/elastic-metal/private-network-api/#path-private-networks-add-a-server-to-a-private-network) |
| 64 | +- Public Gateways: `resource_uuid` corresponds to the [GatewayNetwork](https://www.scaleway.com/en/developers/api/public-gateway/#path-gateway-networks-list-public-gateway-connections-to-private-networks) ID. |
| 65 | +</Message> |
| 66 | + |
| 67 | +DNS cannot resolve or forward queries between different VPCs. It can only resolve hostnames for resources within the same VPC, though they may be on different Private Networks within that VPC. |
| 68 | + |
| 69 | +## Rate limiting |
| 70 | + |
| 71 | +Currently, DNS requests are rate-limited to 50 requests per second per resource. Watch this space as we work to be able to increase this limit to accommodate higher traffic volumes. |
| 72 | + |
| 73 | +## Troubleshooting |
| 74 | + |
| 75 | +If you experience problems with DNS, try the following steps: |
| 76 | + |
| 77 | +1. **Detach and reattach the affected resources from/to the Private Network.** This is effective in solving many issues for older resources, or resources whose name you have changed. |
| 78 | + |
| 79 | +2. **Check resource hostname**. Issues can arise if your resource has a dot in its name. Rename it if necessary to eliminate the dot, and detach/reattach it from the Private Network. |
| 80 | + |
| 81 | +3. **Check Private Network name**. Issues can arise with Private Networks who share a name with a TLD. See our [dedicated document](/network/vpc/troubleshooting/pn-name/) for more help. |
| 82 | + |
| 83 | +4. **Check whether you are using Network Manager**: DNS does not work out of the box for Linux distributions using Network Managed, such as **RockyLinux**. Find out how to resolve this problem [on our troubleshooting page](/network/vpc/troubleshooting/private-dns-dhcp-not-working/#distributions-running-network-manager) |
| 84 | + |
| 85 | +If you are still having problems reaching a resource attached to a Private Network via its hostname, [open a support ticket](https://console.scaleway.com/support). |
0 commit comments