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:
| Namespace | UUID constant | Input type |
|---|---|---|
| DNS | 6ba7b810-9dad-11d1-80b4-00c04fd430c8 | Fully qualified domain name |
| URL | 6ba7b811-9dad-11d1-80b4-00c04fd430c8 | URL string |
| OID | 6ba7b812-9dad-11d1-80b4-00c04fd430c8 | ISO OID string |
| X.500 | 6ba7b814-9dad-11d1-80b4-00c04fd430c8 | X.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
- Not secret — Anyone who knows the input name and the namespace can recompute the UUID. Do not use DNS-namespace UUIDs as authentication tokens or session IDs.
- SHA-1 weakness — UUID v5 uses SHA-1, which is vulnerable to length-extension attacks in some contexts. For security-sensitive deterministic IDs, use UUID v8 with a truncated SHA-256 hash. See UUID Security.
- Not time-sortable — DNS-namespace UUIDs do not sort by creation time. If chronological order matters, use UUID v7 instead. See UUID v4 vs v7.
Related terms
- UUID Namespace — general namespace concept
- UUID v5 — Deterministic — SHA-1 name-based UUID
- UUID Namespaces Guide — implementation and use cases
- RFC 9562 — current UUID standard
- UUID Security — what name-based UUIDs disclose
External references
- RFC 9562 §6.6 — pre-defined namespace UUIDs
- uuid npm package — v5 and v3 support
- Python uuid.NAMESPACE_DNS
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.