简体   繁体   English

如何为具有多个终结点和根的 Azure CDN 配置 DNS

[英]How to configure DNS for Azure CDN with multiple endpoints and root

I own a domain "x.wiki" which is managed via domains.google我拥有一个域“x.wiki”,该域通过 domain.google 进行管理

I have a website, which is split up into multiple endpoints using azure cdn.我有一个网站,它使用 azure cdn 分成多个端点。

  • sub1-x.azureedge.net - Subdomain 1 (intended site route with all content) sub1-x.azureedge.net - 子域 1(包含所有内容的预期站点路由)
  • sub2-x.azureedge.net - Subdomain 2 (subdomain with limited content) sub2-x.azureedge.net - 子域 2(内容有限的子域)
  • sub3-x.azureedge.net - Subdomain 3 (subdomain with limited content) sub3-x.azureedge.net - 子域 3(内容有限的子域)

I want to serve these as follows.我想为这些服务如下。

  • www.x.wiki -> sub1-x.azureedge.net www.x.wiki -> sub1-x.azureedge.net
  • x.wiki -> sub1-x.azureedge.net x.wiki -> sub1-x.azureedge.net
  • sub2.x.wiki -> sub2-x.azureedge.net sub2.x.wiki -> sub2-x.azureedge.net
  • sub3.x.wiki -> sub3-x.azureedge.net sub3.x.wiki -> sub3-x.azureedge.net

currently it only works with www.目前它只适用于 www。 / sub2. / 子 2。 / sub3. / 子 3。

x.wiki doesnt resolve x.wiki 没有解决

Does anyone know how I can get this working correctly?有谁知道我如何才能正常工作?

My understanding is that due to limitations with CNAME i cannot do this easily, however azureCDN to my knowledge does not give me an IP for use with custom domains.我的理解是,由于 CNAME 的限制,我无法轻松做到这一点,但是据我所知,azureCDN 并没有给我一个用于自定义域的 IP。

Here is my DNS configuration.这是我的 DNS 配置。

DNS 配置

You also use alias records to point your DNS zone apex x.wiki to Azure CDN endpoints.还可以使用别名记录将 DNS 区域顶点x.wiki指向 Azure CDN 终结点。 If your domain DNS provider does not support alias record for root domain, you could optionally to host your domain in Azure DNS .如果您的域 DNS 提供商不支持根域的别名记录,您可以选择在 Azure DNS 中托管您的域

In the Azure DNS zone, you could create an alias record like this,在 Azure DNS 区域中,您可以创建这样的别名记录, 在此处输入图片说明

Then, you will see one A record and one CNAME for your CDN endpoint.然后,您将看到 CDN 端点的一个 A 记录和一个 CNAME。 在此处输入图片说明

After the records are verified, you could add the hostname x.wiki in the custom domain of your CDN endpoint.验证记录后,您可以在 CDN 端点的自定义域中添加主机名x.wiki

Alternatively, you could try the workaround in this blog .或者,您可以尝试此博客中的解决方法。

Set up a CNAME “cdnverify.”设置 CNAME “cdnverify”。 to “cdnverify..azureedge.net”.到“cdnverify..azureedge.net”。 Once all is verified and set up (including SSL provisioning if desired), delete the CNAME and use ANAME for the root record.验证并设置所有内容后(如果需要,包括 SSL 配置),删除 CNAME 并使用 ANAME 作为根记录。

The answer to this is to redirect root to WWW from my DNS provider.对此的答案是将 root 从我的 DNS 提供商重定向到 WWW。 The cdnverify cname is not necessary. cdnverify cname 不是必需的。

https://www.tachyonstemplates.com/2018/google-domains-forward-root/ https://www.tachyonstemplates.com/2018/google-domains-forward-root/

May re-open this if i still cant get adsense to resolve the root (because it is a redirect)如果我仍然无法让 AdSense 解析根目录,可以重新打开它(因为它是重定向)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM