Introducing PostScale -- email API for transactional, inbound, and masked addresses. PostScale

    What Is an A Record

    Learn what an A record is and how it connects your domain name to the correct IPv4 address. Includes examples for the DNScale dashboard and API.

    An A (Address) record is the most fundamental DNS record type. It maps a domain name to an IPv4 address, allowing users to access your website using an easy-to-remember name instead of a numeric IP address.

    How A Records Work

    When someone types your domain into a browser:

    1. The browser asks a DNS resolver for the A record
    2. The resolver returns the IPv4 address from the A record
    3. The browser connects to that IP address to load your site
    example.com.    3600    IN    A    192.0.2.1

    This record tells DNS resolvers that example.com points to 192.0.2.1 with a TTL of 3600 seconds (1 hour).

    Common Use Cases

    Single Server Hosting

    Point your domain to a web server:

    example.com.       3600    A    192.0.2.1
    www.example.com.   3600    A    192.0.2.1

    Load Balancing with Multiple A Records

    Distribute traffic across multiple servers using round-robin DNS:

    example.com.    300    A    192.0.2.1
    example.com.    300    A    192.0.2.2
    example.com.    300    A    192.0.2.3

    Subdomains for Different Services

    api.example.com.      3600    A    192.0.2.10
    mail.example.com.     3600    A    192.0.2.20
    staging.example.com.  3600    A    192.0.2.30

    Record Format

    FieldDescriptionExample
    NameDomain or subdomainwww, @ (apex), api
    TypeRecord typeA
    ContentIPv4 address192.0.2.1
    TTLTime to live (seconds)3600

    Adding an A Record

    Using the Dashboard

    1. Navigate to your zone in the DNScale dashboard
    2. Click Add Record
    3. Configure the record:
      • Name: Enter subdomain (e.g., www) or @ for apex
      • Type: Select A
      • Value: Enter the IPv4 address
      • TTL: Set the cache duration (default: 3600)
    4. Click Create Record

    Using the API

    Create an A record:

    curl -X POST "https://api.dnscale.eu/v1/zones/{zone_id}/records" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "www",
        "type": "A",
        "content": "192.0.2.1",
        "ttl": 3600
      }'

    Create multiple A records for load balancing:

    # First server
    curl -X POST "https://api.dnscale.eu/v1/zones/{zone_id}/records" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "@",
        "type": "A",
        "content": "192.0.2.1",
        "ttl": 300
      }'
     
    # Second server
    curl -X POST "https://api.dnscale.eu/v1/zones/{zone_id}/records" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "@",
        "type": "A",
        "content": "192.0.2.2",
        "ttl": 300
      }'

    API Response:

    {
      "status": "success",
      "data": {
        "message": "Record created successfully",
        "record": {
          "id": "encoded-record-id",
          "name": "www.example.com.",
          "type": "A",
          "content": "192.0.2.1",
          "ttl": 3600,
          "disabled": false
        }
      }
    }

    Best Practices

    1. Use appropriate TTL values

      • Short TTL (300-900s) if you expect to change the IP frequently
      • Longer TTL (3600-86400s) for stable servers to improve caching
    2. Add both A and AAAA records - Support both IPv4 and IPv6 for better connectivity

    3. Consider redundancy - Use multiple A records for high-availability setups

    4. Apex domain records - Use @ or leave name empty for the root domain

    • AAAA - IPv6 equivalent of A records
    • CNAME - Alias to another domain name
    • ALIAS - Root domain aliasing

    Conclusion

    A records are the foundation of DNS, enabling the internet's domain name to IP address translation. With DNScale, managing A records is straightforward whether you're hosting a single website or building a load-balanced infrastructure.