How to configure DNS records for a domain

· Category: Networking

Short answer

DNS records map domain names to IP addresses, mail servers, and verification strings. Configuring them correctly is essential for website availability, email delivery, and service authentication.

Steps

  1. Log into your DNS provider: Access the management console for your domain registrar or third-party DNS host.

  2. Add an A record: Point your root domain (@) or subdomain to an IPv4 address. For IPv6, use an AAAA record.

  3. Add a CNAME record: Create aliases so subdomains like www point to your main domain or another hostname.

  4. Configure MX records: Specify mail servers responsible for receiving email, prioritized by preference numbers.

  5. Add TXT records: Include SPF, DKIM, and DMARC entries for email security, or verification strings for third-party services.

  6. Set TTL values: Use short TTLs during migration for faster propagation, and longer TTLs for stability.

Tips

  • Avoid CNAME conflicts at the root domain; use ALIAS or ANAME if your provider supports them.
  • Always include a PTR record for mail servers to improve deliverability.
  • Test changes with dig or nslookup before considering them final.

Common issues

  • Typos in hostnames or IP addresses.
  • Missing SPF records causing emails to land in spam.
  • Long TTLs delaying critical changes.