Skip to content

17. Domain Names

Domain names are human-readable addresses that identify websites on the internet. Instead of remembering numeric IP addresses like 192.0.2.1, users can type memorable names like example.com. Domain names are essential for web development, as they provide the identity and address for websites. Understanding domain names helps you configure websites and understand how the web addressing system works.

A domain name is a string that identifies a realm of administrative autonomy, authority, or control on the internet. It’s part of the URL that users type to access websites.

www.example.com
│ │ │
│ │ └─ Top-Level Domain (TLD)
│ └─ Second-Level Domain
└─ Subdomain
  • Subdomain: Optional prefix (www, mail, blog)
  • Domain name: Main identifier (example)
  • TLD: Top-level domain (.com, .org, .net)

Common TLDs:

  • .com: Commercial (most popular)
  • .org: Organizations
  • .net: Network
  • .edu: Educational
  • .gov: Government

Country-specific:

  • .us: United States
  • .uk: United Kingdom
  • .ca: Canada
  • .au: Australia

Modern TLDs:

  • .app: Applications
  • .dev: Development
  • .io: Tech companies
  • .xyz: Generic

Companies that sell domains:

  • GoDaddy: Popular registrar
  • Namecheap: Affordable option
  • Google Domains: Google service
  • Cloudflare: Registrar and DNS
  1. Choose domain: Select available name
  2. Check availability: Verify it’s available
  3. Register: Purchase domain
  4. Configure DNS: Set up DNS records
  5. Renew: Maintain registration

Point domain to IP address:

example.com → 192.0.2.1

Create aliases:

www.example.com → example.com

Create subdomains:

blog.example.com
mail.example.com
api.example.com
  • Memorable: Easy to remember
  • Short: Keep it concise
  • Relevant: Reflects brand/content
  • Available: Check availability
  • SEO-friendly: Consider keywords
  • WHOIS privacy: Protect personal information
  • Domain locking: Prevent unauthorized transfers
  • Two-factor authentication: Secure account access
  • Renewal reminders: Avoid expiration

Local domains for testing:

localhost
127.0.0.1
local.example.com (via hosts file)

Map domains locally:

127.0.0.1 local.example.com

Configure for production:

  • DNS records: Point to server
  • SSL certificates: HTTPS setup
  • Subdomains: Configure as needed