Configure DNS Records
Managing DNS records in Cloudflare via dashboard or API.
Via Dashboard
- Log in to Cloudflare Dashboard
- Select the domain
- Navigate to DNS > Records
- Click Add Record
- Choose record type, enter name and value
- Toggle proxy status (orange cloud = proxied, grey cloud = DNS only)
- Click Save
Via API
curl -X POST "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
--data '{
"type": "A",
"name": "example.com",
"content": "192.0.2.1",
"ttl": 120,
"proxied": true
}'
Best Practices
- Use proxied (orange cloud) for web traffic to enable security features
- Keep TTL at Auto (120) for proxied records
- Set longer TTLs for records that change infrequently
- Use CNAME flattening for root domain CNAME support
Related
- Dns — DNS fundamentals
- Setup Custom Domain — Custom domain setup