{"id":2591,"date":"2019-10-22T16:58:14","date_gmt":"2019-10-22T08:58:14","guid":{"rendered":"https:\/\/www.mondoze.com\/guide\/?post_type=kb&p=2591"},"modified":"2022-10-05T08:02:51","modified_gmt":"2022-10-05T00:02:51","slug":"managing-dns-records-in-cloudflare","status":"publish","type":"kb","link":"https:\/\/www.mondoze.com\/guide\/kb\/managing-dns-records-in-cloudflare","title":{"rendered":"Managing DNS records in Cloudflare"},"content":{"rendered":"\t\t
DNS translates domain names to IP addresses and that’s why it is often call the “phonebook of the Internet.”<\/p>
When you first add a domain to Cloudflare, a scan of common DNS records is perform in an attempt to automatically add all of the domain’s DNS records to the Cloudflare DNS<\/strong>\u00a0app. If you need to add records manually for a domain, follow the procedure below:<\/p> If your domain is add to Cloudflare via one of our hosting partners, manage your DNS records via the hosting partner. In this case, the Cloudflare DNS<\/strong>\u00a0app informs customers to manage DNS outside of Cloudflare.<\/p> 1. Log in to the Cloudflare dashboard.<\/p> 2. Click the appropriate Cloudflare account for the domain where you will add records.<\/p> 3. Ensure the proper domain is selected.<\/p> 4. Click the\u00a0DNS\u00a0<\/strong>app.<\/p> 5. The UI interface for adding DNS records appears under\u00a0DNS Records<\/strong>:<\/p> 6. Replace\u00a0Name<\/strong>\u00a0with a subdomain or the root domain.<\/p> Per Internet standards,\u00a0Name<\/strong>\u00a0must:<\/p> Additionally, Cloudflare allows an underscore\u00a0_<\/em>\u00a0in the\u00a0A<\/em>\u00a0and\u00a0CNAME record\u00a0<\/em>Name<\/strong>\u00a0since some modern web services support an underscore. However, Cloudflare discourages using underscores due to limited browser support.<\/p> 7. (Optional) Some record types such\u00a0A<\/em>,\u00a0AAAA<\/em>, and\u00a0CNAME<\/em>\u00a0allow a customer to toggle the Cloudflare proxy on or off. \u00a0For the\u00a0Cloudflare Proxy Toggle:<\/strong><\/p> Grey cloud icons for\u00a0A<\/em>,\u00a0AAAA<\/em>, or\u00a0CNAME records<\/em>\u00a0will expose your origin IP address to attackers and allows them to attack your origin IP address directly even if you later proxy traffic to Cloudflare. \u00a0Direct attacks to your origin IP are only mitigated by asking your hosting provider to change your origin IP address.<\/p> 8. The\u00a0Type<\/strong>\u00a0selection defaults to\u00a0A records. \u00a0<\/em>Expand the DNS record types in the tables below for further instructions pertaining to each record type:<\/p> To ensure visitor traffic reaches a domain, a domain requires at least an\u00a0A or AAAA record<\/em>\u00a0to point to the origin web server IP address or a\u00a0CNAME record<\/em>\u00a0that points to the hostname of a hosting service.<\/p> Critical DNS records for IP address resolution:<\/p> A Records<\/em>\u00a0are necessary to direct a visitor’s browser requests to an origin web server.<\/p> To add an\u00a0A record<\/em>:<\/p> 1. Replace\u00a0Value<\/strong>\u00a0with a real address (Please note you cannot use a Cloudflare IP). 2. Click\u00a0Add Record<\/strong>. Cloudflare Load Balancing is the recommend solution for spreading traffic across multiple IP addresses while only sending traffic to reachable IP addresses.<\/p> CNAME Records<\/em>\u00a0are necessary to direct a visitor’s browser requests to an origin web server. \u00a0Unlike an\u00a0A record<\/em>, the\u00a0CNAME<\/em>\u00a0will point to a hostname like\u00a0www.example.com\u00a0instead of an IP address.\u00a0www.example.com\u00a0would then either have an\u00a0A record<\/em>\u00a0that lists the IP address or use another\u00a0CNAME record\u00a0<\/em>that points to a different hostname. Eventually, a chain of\u00a0CNAME records<\/em>\u00a0must point to a hostname that resolves to an IP address.<\/p> To add a\u00a0CNAME record<\/em>:<\/p> 1. Replace\u00a0Value<\/strong>\u00a0with the target (destination) domain. 2. Click\u00a0Add Record<\/strong>.<\/p> 1. Replace\u00a0Value<\/strong>\u00a0with a real address.<\/p> Example:\u00a02001:db8:ffff:ffff:ffff:ffff:ffff:ffff<\/em><\/p> 2. Click\u00a0Add Record<\/strong>.<\/p> DNS records for email and email authentication:<\/p> TXT records<\/em> are commonly use for mail authentication.<\/p> Review the\u00a0SPF<\/em>\u00a0and\u00a0DKIM<\/em>\u00a0sections of this table for examples.<\/p> To add a\u00a0TXT record<\/em>:<\/p> 1. Replace\u00a0Value<\/strong>\u00a0with real data. MX Records<\/em>\u00a0are necessary for delivery of email to a mail server. Any MX record\u00a0Server<\/strong>\u00a0name requires a corresponding A record that lists the IP address of the mail server.<\/p> To add an\u00a0MX record<\/em>:<\/p> 1. Click on the\u00a0Value<\/strong>\u00a0field to open a popup window for supplying further\u00a0MX record<\/em>\u00a0details: Server\u00a0<\/strong>is the DNS hostname of the mail server.<\/p> Priority<\/strong>\u00a0is a relative number. 2. Click\u00a0Save<\/strong>.<\/p> 3. Click\u00a0Add Record<\/strong>.<\/p> A typical\u00a0MX\u00a0<\/em>record\u00a0<\/em>Name<\/strong>\u00a0is the root domain such as\u00a0example.com<\/em>. However, reach out to your email hosting provider to confirm the\u00a0MX\u00a0<\/em>Name<\/strong>\u00a0and\u00a0Server<\/strong>\u00a0details.<\/p> There is no\u00a0DKIM record<\/em> type. \u00a0DKIM is instead configure as a DNS\u00a0TXT record<\/em>.<\/p> DKIM records<\/em>\u00a0can often exceed the 255-character limit for\u00a0TXT records<\/em>. Therefore, Cloudflare will automatically split these into multiple records at the same domain name, producing a record with a format similar to the following when queried:<\/p> Remove quotation marks and spaces when adding\u00a0DKIM records<\/em>\u00a0to your zone. Also, you do not need to prefix (escape) semicolons with a “\\” character for\u00a0DKIM records<\/em>\u00a0added to Cloudflare.<\/p> http:\/\/dkimcore.org\/tools\/\u00a0is a recommended online DKIM validation tool.<\/p> Some services require additional\u00a0CNAME records<\/em>\u00a0for DKIM verification. Verification will fail for CNAME records used to verify DKIM unless there is a grey-cloud icon beside the\u00a0CNAME record<\/em>\u00a0in the\u00a0DNS<\/strong>\u00a0app.<\/p> 1. Replace\u00a0Value<\/strong>\u00a0with real data.<\/p> DNS specifications have deprecate the SPF record<\/em>\u00a0type in favor of\u00a0TXT records<\/em>.<\/p> Although Cloudflare and other DNS providers\u00a0 that most support the dedicated SPF record<\/em>\u00a0types, some DNS clients may instead look for a\u00a0TXT record<\/em>.<\/p> Add both a\u00a0SPF record<\/em>\u00a0and a\u00a0TXT record<\/em>\u00a0to your domain to ensure backwards compatibility.<\/p> SPF content as a\u00a0TXT record<\/em>\u00a0will look similar to the following:<\/p> Further details on\u00a0SPF record<\/em> syntax can be find at openspf.org. Contact your mail provider about SPF record<\/em>\u00a0content if you observe SPF failures in your email headers or if your mail is undeliverable.<\/p> Domain-based Message Authentication, Reporting & Conformance (DMARC) allows an email recipient to know if the email is protect by SPF and\/or DKIM. DMARC describes how the email recipient should process the email if neither of those authentication methods passes.<\/p> There is no\u00a0DMARC record<\/em> type. \u00a0DMARC is instead configure as a DNS\u00a0TXT record<\/em>.<\/p> To learn more about DMARC records, visit the DMARC project.<\/p> Specialized DNS records:<\/p> 1. Replace\u00a0Value<\/strong>\u00a0with real data.<\/p> 1. Click on the\u00a0Value<\/strong>\u00a0field to open a popup window for supplying SRV record details:<\/p> 2. Create the\u00a0SRV name<\/strong>. For example:<\/p> Service<\/strong>:\u00a0_xmpp-client<\/em><\/p> Protocol<\/strong>:\u00a0tcp<\/em> 3. Click\u00a0Save<\/strong>. Cloudflare will combine the\u00a0Service<\/strong>,\u00a0Protocol<\/strong>, and\u00a0Name<\/strong>\u00a0fields to create the\u00a0SRV record<\/em>name.<\/p> 4. A new window will appear requesting to add the\u00a0SRV content:<\/strong><\/p> \u00a0 \u00a0 \u00a0 5. Add the\u00a0SRV content<\/strong>. For example :<\/p> Priority<\/strong>:\u00a05<\/em><\/p> Weight<\/strong>:\u00a00<\/em><\/p> Port<\/strong>:\u00a05222<\/em><\/p> Target<\/strong>:\u00a0talk.l.google.com<\/em><\/p> 6. Click\u00a0Save<\/strong>.<\/p> Using the example data below, a DNS query for the SRV record<\/em>\u00a0would return the following response:<\/p> For proxied domains, Cloudflare responds to DNS queries with its own shared, dynamic IP addresses. \u00a0Therefore,\u00a0PTR records<\/em> cannot be add to Cloudflare.<\/p> The\u00a0PTR record<\/em>\u00a0option shown in the\u00a0DNS Records<\/strong>\u00a0dropdown is not for adding\u00a0PTR records<\/em>\u00a0for Reverse DNS resolution. \u00a0It is instead for adding a\u00a0PTR Record<\/em> to the Forward DNS resolution for the domain. PTR in Forward DNS is allow under the DNS specification.<\/p> The main reason to have a\u00a0PTR record<\/em>\u00a0is to prevent emails from ending up in spam folders. Since Cloudflare doesn’t support email traffic by default, you would instead need to set the\u00a0PTR record<\/em> where your email server is locate. \u00a0Please reach out to your email provider for assistance.<\/p> Customers which with Enterprise domains using Cloudflare’s DNS Firewall<\/strong>\u00a0feature can request Cloudflare Support for assistance with updating PTR records. There is no need to configure\u00a0SOA records<\/em> when using Cloudflare’s nameservers as the authoritative nameservers. Therefore ,Cloudflare automatically creates the SOA record<\/em>\u00a0when you migrate your domain to Cloudflare.<\/p> Cloudflare can proxy certain DNS records.<\/p> 1. Log in to the Cloudflare dashboard.<\/p> 2. Click the appropriate Cloudflare account for the domain where you will delete records.<\/p> 3. Ensure the proper domain is select.<\/p> 4. Click the\u00a0DNS\u00a0<\/strong>app.<\/p> 5. Under\u00a0DNS Records<\/strong>, click\u00a0X<\/strong>\u00a0to delete a specific DNS record.<\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":" How To Manage DNS Records in Cloudflare What is DNS? DNS translates domain names to IP addresses and that’s why it is often call the “phonebook of the Internet.” Adding DNS records When you first add a domain to Cloudflare, a scan of common DNS records is perform in an attempt to automatically add all …<\/p>\n
<\/p>A<\/strong><\/h4>
Example:\u00a0203.0.113.34<\/em><\/p>
Multiple\u00a0A records<\/em> for the same subdomain can be add with different IP addresses. Cloudflare’s DNS will alternate requests to the various IP addresses provided. However, Cloudflare’s DNS will continue to alternate traffic to all specified IP addresses even if an IP address is unreachable.<\/p>CNAME<\/strong><\/h4>
Example:\u00a0mysite.myhost.com<\/em>
Example:\u00a0s3-eu-west-1.amazonaws.com<\/em><\/p>AAAA<\/strong><\/h4>
TXT<\/strong><\/h4>
2. Click\u00a0Add Record<\/strong>.<\/p>MX<\/strong><\/h4>
<\/p>
The lowest\u00a0Priority<\/strong>\u00a0number in a group of\u00a0MX records<\/em>\u00a0will have priority over the rest.<\/p>DKIM<\/strong><\/h4>
default._domainkey.example.com. 299 IN TXT \"v=DKIM1; k=rsa; p=\" \";\"<\/code><\/p>SPF<\/strong><\/h4>
TXT @ v=spf1 include:example.net -all<\/pre>
DMARC<\/strong><\/h4>
CAA<\/strong><\/h4>
SRV<\/strong><\/h4>
<\/p>
Name<\/strong>:\u00a0yourdomain.com<\/em><\/p>
<\/strong><\/p>_xmpp-client._tcp.yourdomain.com. IN SRV 5 0 5222 talk.l.google.com.<\/pre>
PTR<\/strong><\/h4>
<\/strong><\/p>SOA<\/strong><\/h4>
Deleting DNS records<\/strong><\/h3>