# Can a domain name contain spaces or underscores?

Canonical: https://www.namesilo.com/questions/buying-domains/can-a-domain-name-contain-spaces-or-underscores

Published: 2026-11-17

Last updated: 2026-11-19

Topic: Buying a domain

Ordinary ASCII website hostname labels use letters, digits and permitted hyphens, so spaces, underscores, apostrophes and ampersands are not part of that hostname syntax. RFC 1035 §2.3.1 defines the basic rule, updated by RFC 1123 §2.1 to allow an initial digit. General DNS owner names are broader than website hostnames.

Choose a permitted website spelling

RFC 2181 §11 distinguishes DNS-label permissiveness from application-specific restrictions. Keep a brand’s punctuation in its display name if desired, and choose a hostname spelling separately; special DNS service labels are not evidence that the same spelling is suitable for a website hostname.

Your next steps

Remove spaces and unsupported punctuation from hostname options

Use letters, digits and permitted hyphens

Check the registry’s exact-name validation

Keep the selected spelling consistent in public materials

Choose a permitted website spelling

RFC 2181 §11 distinguishes DNS-label permissiveness from application-specific restrictions. Keep a brand’s punctuation in its display name if desired, and choose a hostname spelling separately; special DNS service labels are not evidence that the same spelling is suitable for a website hostname.

Verified detail: RFC 1035 §2.3.1 defines the letter/digit/hyphen hostname syntax; RFC 1123 §2.1 additionally permits an initial digit.

Your next step: Keep the selected spelling consistent in public materials.

## Sources

- [IETF RFC 1035 §2.3.1](https://www.rfc-editor.org/rfc/rfc1035#section-2.3.1)

- [IETF RFC 1123 §2.1](https://www.rfc-editor.org/rfc/rfc1123#section-2.1)

- [IETF RFC 2181](https://www.rfc-editor.org/rfc/rfc2181.txt)
