如何创建子域以及它们如何工作? [英] How to create a subdomain and how do they work?

查看:20
本文介绍了如何创建子域以及它们如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的主域之外创建一个子域,以便在家里访问我的 raspberry pi.我的域名注册公司对每个子域名收取 10 英镑,所以我认为可能有一种更简单(更便宜)的创建方法.如果我更多地了解它们以及它们是如何创建的,那也会有所帮助.

I would like to create a subdomain off of my main domain for accessing my raspberry pi at home. My domain register company charges £10 for every subdomain so I thought there might be an easier (and cheaper) way of creating one. It would also help if I knew a little more about them and how they are created.

推荐答案

DNS 基于可扩展性和/或粒度的层次结构而构建.

DNS is built off of a hierarchy for scale-ability and/or for granularity.

如果我们使用像 www.stackoverflow.com 这样的域名.并分解它,这就是我们得到的.

If we take the a domain like www.stackoverflow.com. and break it down, here is what we get.

  1. www - 这是域的主机部分.它要么是 A 记录,要么是 CNAME,最终指向一个 IP 地址.
  2. stackoverflow - 这是域级别之一.它有自己的 DNS 服务器和由 stackoverflow 团队管理的配置.这允许该团队管理特定于他们需要的条目.
  3. com - 这称为 TLD(顶级域).以 .com 结尾的所有其他域在com"DNS 服务器上都有一个条目.
  4. .- 这称为ROOT.全球有 20 个 somodd 根 DNS 服务器.这些服务器用于识别 .com、.org、.edu、.gov 等 dns 服务器的位置.

从客户端的角度来看,当您查询 www.stackoverflow.com 时会发生什么:

From a client perspective what happens when you query www.stackoverflow.com is:

  1. 您查询 .名称服务器询问 com dns 服务器在哪里.
  2. 您查询 com dns 服务器以询问 stackoverflow dns 服务器在哪里.
  3. 您查询 stackoverflow dns 服务器以询问 www 在哪里.

子域只是意味着您在组合中添加了额外的 DNS 服务器层,以便您可以在组合中添加更多的可扩展性和/或粒度.

A subdomain simply means that you add an additional layer of DNS servers in the mix so that you can add more scale-ability and/or granularity to the mix.

例如,如果我们的 dns 名称是:www.foo.stackoverflow.com,我们现在将拥有 foo dns 服务器层.

For example, if our dns name is: www.foo.stackoverflow.com we would now have the foo dns server layer.

话虽如此,我认为您不需要子域.您可能只需要一个额外的 DNS A 记录或 CNAME.例如:

Having said that, I do not think that you need a subdomain. You probably just need an additional DNS A record or CNAME. For example:

raspberry.stackoverflow.com 而不是 raspberry.foo.stackoverflow.

raspberry.stackoverflow.com instead of raspberry.foo.stackoverflow.

他们不应为额外的主机条目(A 记录或 CNAME)收取额外费用,仅适用于子域.

They should not charge extra for additional host entries (A record or CNAME), only for subdomains.

这篇关于如何创建子域以及它们如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆