验证域所有权

发布于 2024-08-09 00:52:42 字数 309 浏览 18 评论 0原文

作为网站所有者设置 Google Adsense 或 Gmail 时,您需要修改CNAME记录以进行验证。微软也做了同样的事情

我正在构建一个网站,我希望群组的所有者以相同的方式验证域的所有权。我该如何实现这个目标?

When setting up Google Adsense or Gmail as a site owner, you are required to modify a CNAME record for verification. Microsoft does the same thing.

I am building a website where I would like an owner of a group to verify ownership of a domain in the same way. How do I accomplish this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

陌若浮生 2024-08-16 00:52:42

有很多方法可以做到这一点。按优先顺序列出:

我建议实施这些的一些组合。对于无法将内容插入其网站的 部分的人来说,最后一个应该是最后的手段。如果做得好,许多用户可能无需采取任何操作就可以声明其域的所有权,前提是他们已经向您提供了电子邮件地址。

对于获取 DNS 信息的具体问题,请尝试以下操作:

$ dig TXT google.com

; <<>> DiG 9.4.3-P3 <<>> TXT google.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4045
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;google.com.            IN  TXT

;; ANSWER SECTION:
google.com.     3600    IN  TXT "v=spf1 include:_netblocks.google.com ip4:216.73.93.70/31 ip4:216.73.93.72/31 ~all"

;; Query time: 131 msec
;; SERVER: 208.67.222.222#53(208.67.222.222)
;; WHEN: Sat Oct 24 16:50:56 2009
;; MSG SIZE  rcvd: 122

此特定查询为您提供 google.com 的 SPF 条目。您可以轻松地执行以下操作:

dig TXT verify.example.com

然后检查答案部分中的确认码。

There's lots of ways to do this. Listed in order of preference:

I would recommend implementing some combination of these. The last one should be a measure of last resort for people who can't insert things into the <head> section of their sites. Done well, many users might be able to claim ownership of their domain without having to take any action at all, provided they've supplied you with an email address already.

For the specific issue of getting DNS information, try this:

$ dig TXT google.com

; <<>> DiG 9.4.3-P3 <<>> TXT google.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4045
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;google.com.            IN  TXT

;; ANSWER SECTION:
google.com.     3600    IN  TXT "v=spf1 include:_netblocks.google.com ip4:216.73.93.70/31 ip4:216.73.93.72/31 ~all"

;; Query time: 131 msec
;; SERVER: 208.67.222.222#53(208.67.222.222)
;; WHEN: Sat Oct 24 16:50:56 2009
;; MSG SIZE  rcvd: 122

This particular query gives you the SPF entries for google.com. You could just as easily do:

dig TXT verify.example.com

Then check the confirmation code in the answer section.

昨迟人 2024-08-16 00:52:42

您需要向 DNS 服务器查询该域的 CNAME 记录。它可以像使用 dig/nslookup/etc 并从中抓取数据或使用平台/语言的名称解析功能一样简单。

You need to query DNS server for the CNAME record of that domain. It can be as simple as using dig/nslookup/etc and scraping data from it or using name resolving capabilities of your platform/language.

妄断弥空 2024-08-16 00:52:42

您可能也意识到这种技术并且已经放弃了它(因为这确实显示了谁拥有对站点而不是您指定的域的控制权),但是您可以要求该人将特定名称和内容的文件放在域的根级别。

例如:

http://www.blahdeblah.net/**verify.txt**

一个优点是,一旦他们这样做,您就不必等待更改传播,它会立即生效。

You might also be aware of this technique and already dismissed it (since this really shows who has control over a site rather than a domain as you specify), but you could ask the person to place a file of a specific name and content on the root level of the domain.

For example:

http://www.blahdeblah.net/**verify.txt**

The one advantage is that once they do this you don't have to wait for changes to propagate, its immediate.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文