Back to Blog
team@tinypod.app

Understanding DNS for Self-Hosted Services

DNS is how your domain name points to your server. A, AAAA, CNAME, TXT records explained — and how to set them up for self-hosting.

dnsnetworkingdomainsguide

What Is DNS?


DNS (Domain Name System) translates domain names (gitea.example.com) into IP addresses (203.0.113.1). When someone visits your self-hosted service, DNS tells their browser which server to connect to.


DNS Record Types


A Record

Points a domain to an IPv4 address.

  • gitea.example.com → 203.0.113.1

  • AAAA Record

    Points a domain to an IPv6 address.

  • gitea.example.com → 2001:db8::1

  • CNAME Record

    Points a domain to another domain (alias).

  • grafana.example.com → myserver.example.com

  • TXT Record

    Stores text data. Used for verification, SPF, DKIM.

  • _verification.example.com → verify=abc123

  • MX Record

    Mail server routing.

  • example.com → mail.example.com (priority 10)

  • DNS for Self-Hosting


    Single Server, Multiple Services

    Point multiple subdomains to the same IP:

  • gitea.example.com → A → 203.0.113.1
  • grafana.example.com → A → 203.0.113.1
  • wiki.example.com → A → 203.0.113.1

  • Your reverse proxy (Caddy/Traefik) routes based on the hostname.


    Wildcard DNS

    *.example.com → A → 203.0.113.1


    Every subdomain resolves to your server. Combine with wildcard SSL.


    DNS Providers


  • Cloudflare (free, with proxy/CDN)
  • Namecheap DNS
  • Route 53 (AWS)
  • Your registrar's DNS

  • Cloudflare Benefits


  • DDoS protection
  • CDN/caching
  • DNS-level analytics
  • Proxy mode (hides server IP)
  • Free SSL (even without Let's Encrypt)

  • TTL (Time to Live)


    How long DNS resolvers cache your record. Lower TTL = faster propagation when you change records, but more DNS queries.


  • During setup: 300 seconds (5 minutes)
  • After stable: 3600 seconds (1 hour) or higher

  • DNS is the foundation of self-hosting. Understanding it makes everything else easier.