UUID Namespace
UUID v5 DNS Namespace
The DNS namespace is the standard namespace for deriving identifiers from fully-qualified domain names — the most common choice for name-based UUIDs.
Well-known RFC namespace6ba7b810…Deterministic (SHA-1)
Generated locally with the Web Crypto API — nothing leaves your browser.
What Is UUID v5 DNS Namespace?
- RFC 4122 defines four well-known namespaces. The DNS one uses the identifier
6ba7b810-9dad-11d1-80b4-00c04fd430c8and exists so that UUIDs derived from domain names never collide with UUIDs derived from URLs, OIDs or X.500 DNs. - A v5 UUID is the SHA-1 hash of the namespace UUID concatenated with the name bytes. Because hashing is deterministic,
example.comalways maps to the same identifier — anywhere, on any machine, forever.
How to generate
- Select version v5 in the generator.
- Set the namespace to dns.
- Enter a domain name, e.g.
example.com, then generate.
Use Cases
- Stable IDs for hostnames across distributed services.
- Content addressing where the same domain must always yield the same key.
- Idempotent imports that must not create duplicate rows on re-run.
Code Examples
Python
import uuid
uid = uuid.uuid5(uuid.NAMESPACE_DNS, 'example.com')JavaScript
import { v5 as uuidv5 } from 'uuid';
const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';
const id = uuidv5('example.com', DNS);SQL
SELECT uuid_generate_v5('6ba7b810-9dad-11d1-80b4-00c04fd430c8', 'example.com');Frequently Asked Questions
Is v5 reversible?
No. It is a one-way SHA-1 hash, so you cannot recover the domain name from the UUID.
Why not use v4 for the same domain?
v4 is random — the same domain would produce a different identifier each run, breaking idempotency.
Does DNS need to resolve?
No. The name is hashed as a string; no lookup occurs.