Definition

The UUID DNS namespace is a pre-defined UUID constant specified in RFC 9562 §6.6:

6ba7b810-9dad-11d1-80b4-00c04fd430c8

It is used as the namespace argument when generating a name-based UUID (v3 or v5) from a fully qualified domain name (FQDN). The output is deterministic: the same FQDN and the same namespace always produce the same UUID, on any machine, in any language. See UUID Namespace for the general concept.

Standard namespace constants

RFC 9562 defines four pre-set namespace UUIDs:

NamespaceUUID constantInput type
DNS6ba7b810-9dad-11d1-80b4-00c04fd430c8Fully qualified domain name
URL6ba7b811-9dad-11d1-80b4-00c04fd430c8URL string
OID6ba7b812-9dad-11d1-80b4-00c04fd430c8ISO OID string
X.5006ba7b814-9dad-11d1-80b4-00c04fd430c8X.500 DN in DER or text

Using the wrong namespace for the input type (e.g., the URL namespace for a domain name) is not an error — but it produces a different UUID than the DNS namespace would. Stick to the matching namespace for interoperability.

Generating a DNS-namespace UUID

import { v5 as uuidv5 } from 'uuid';

const DNS_NAMESPACE = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';

// Same input always produces the same output
const id = uuidv5('www.example.com', DNS_NAMESPACE);
// → 'cfbff0d1-9375-5685-968c-48ce8b15ae17'  (deterministic)
import uuid

# Python standard library
id = uuid.uuid5(uuid.NAMESPACE_DNS, 'www.example.com')
# → UUID('cfbff0d1-9375-5685-968c-48ce8b15ae17')
import "github.com/google/uuid"

id := uuid.NewSHA1(uuid.NameSpaceDNS, []byte("www.example.com"))
// → cfbff0d1-9375-5685-968c-48ce8b15ae17

All three produce the same UUID — this is the point of a standardised namespace. See UUID v5 — Deterministic for the SHA-1 computation detail and UUID Namespaces for the full implementation guide.

Use cases

Content-addressable IDs — Assign a stable UUID to a web resource using its canonical domain:

// Build a stable ID for a canonical URL
const pageId = uuidv5('https://www.example.com/article/42', URL_NAMESPACE);

Deduplication — If the same domain appears in multiple data sources, uuidv5(domain, DNS_NAMESPACE) produces the same ID in all of them — enabling deduplication without a central lookup table.

Deterministic test fixtures — Generate predictable UUID values in tests without hardcoding:

const testOrderId = uuidv5('test-order-1', DNS_NAMESPACE);
// Always '...' — no random seed needed

See UUID Testing Strategies for more fixture patterns.

Limitations

External references

Frequently asked questions

What is the UUID DNS namespace?

The UUID DNS namespace is a pre-defined UUID constant — 6ba7b810-9dad-11d1-80b4-00c04fd430c8 — defined in RFC 9562 (and its predecessor RFC 4122). It is used as the namespace argument when generating UUID v3 (MD5) or UUID v5 (SHA-1) from a fully qualified domain name. The result is a deterministic 128-bit identifier unique to that domain name. See UUID Namespace for the general namespace concept.

Is UUID v3 or v5 better for DNS-based UUIDs?

UUID v5 (SHA-1) is preferred over UUID v3 (MD5). MD5 is cryptographically broken — it is vulnerable to collision attacks — making UUID v3 unsuitable for any security-sensitive context. UUID v5 uses SHA-1, which is stronger (though also not recommended for new cryptographic applications). For a completely new design, consider UUID v8 with a modern hash (SHA-256 truncated to 122 bits) as the payload. See UUID v5 — Deterministic.