Skip to main content

一文看懂,AWS Registered domains 的 NS 字段 与 Hosted zone 的 NS 字段

Registered domains 的 NS 字段 与 Hosted zone 的 NS 字段 的 区别是:

- Registered domains 的 NS 字段 是指定您的域名应该由哪些 DNS 服务器来解析的。它决定了您的域名的 DNS 请求被发送到哪个 DNS 服务商,例如 Route 53。

- Hosted zone 的 NS 字段 是由 Route 53 自动生成的,反映了 Route 53 为您的托管区域分配的名称服务器的地址。它决定了您的域名的 DNS 解析结果是由哪些 DNS 服务器提供的。

简单来说,Registered domains 的 NS 字段 是您的域名的 DNS 解析的入口,而 Hosted zone 的 NS 字段 是您的域名的 DNS 解析的出口。


当浏览器请求一个域名,例如 tcpbuilder.com 时,是如何使用 Registered domains 的 NS 字段 与 Hosted zone 的 NS 字段 的,具体过程如下:


- 浏览器首先会检查本地缓存或者 hosts 文件,看是否有 abc.com 对应的 IP 地址。如果有,就直接访问该 IP 地址。如果没有,就需要进行 DNS 解析。

- 浏览器会向本地配置的 DNS 服务器(通常是运营商提供的)发送一个查询请求,询问 tcpbuilder.com 的 IP 地址。

- DNS 服务器会根据 tcpbuilder.com 的 TLD(.com)找到对应的根域名服务器,向其发送查询请求。

- 根域名服务器会返回负责 .com 域的顶级域名服务器的地址,DNS 服务器再向其发送查询请求。

- 顶级域名服务器会返回负责 abc.com 域的权威域名服务器的地址,DNS 服务器再向其发送查询请求。

- 权威域名服务器会返回 abc.com 域的 IP 地址,DNS 服务器将其缓存并返回给浏览器。

- 浏览器根据得到的 IP 地址,与 tcpbuilder.com 域的 web 服务器建立 TCP 连接,发起 HTTP 请求。

在这个过程中,Registered domains 的 NS 字段 和 Hosted zone 的 NS 字段 起到了不同的作用:

- Registered domains 的 NS 字段 是在顶级域名服务器中记录的,用于指定 tcpbuilder.com 域的权威域名服务器的地址。⁴

- Hosted zone 的 NS 字段 是在权威域名服务器中记录的,用于指定 tcpbuilder.com 域的 DNS 记录,包括 IP 地址,别名,邮件服务器等。


Registered domains的 NS字段 与 Hosted zones的 NS字段不一致

是应该修改 Hosted zones的 NS字段,还是修改 Registered domains的 NS字段?


应该修改 **Registered domains** 的 NS 字段,使其与 **Hosted zones** 的 NS 字段相同。这样,域的 DNS 请求就会被正确地发送到 Route 53,而不是您之前的 DNS 服务提供商。

修改 **Registered domains** 的 NS 字段的步骤如下:

- 登录到 AWS 管理控制台,并导航到 Route 53 服务。

- 在左侧导航栏中,选择 **Registered domains**。

- 选择您的域,然后在 **Details** 面板中,单击 **Add or edit name servers**。

- 在弹出的对话框中,输入您的 **Hosted zones** 的 NS 字段中显示的四个名称服务器的值,然后单击 **Update**。

- 等待 DNS 更改在 Internet 上传播。这可能需要一段时间,取决于您的域的 TTL 设置。

- 使用 Route 53 控制台或其他工具测试您的域的 DNS 解析是否正确。


如果修改 Hosted zones的 NS字段,让它与 Registered domains的 NS字段 一致,这样是否可以呢?

不,这样做是不正确的。不能修改 Hosted zones 的 NS 字段,因为它是由 Route 53 自动生成的,反映了 Route 53 为您的托管区域分配的名称服务器。如果您修改了 Hosted zones 的 NS 字段,您可能会导致您的域的 DNS 解析出现问题。

您应该只修改 Registered domains 的 NS 字段,使其与 Hosted zones 的 NS 字段相同。这样,您的域的 DNS 请求就会被正确地发送到 Route 53,而不是您之前的 DNS 服务提供商。


www.tcpbuilder.com

email:  tcpfast@gmail.com 

Comments

Popular posts from this blog

How to Set Buffer Size for TCP Socket Programming in C++

TCP socket programming is a common way to communicate between different processes or machines over the network. However, one of the challenges of TCP socket programming is how to set the buffer size for sending and receiving data. The buffer size determines how much data can be stored in memory before it is transmitted or processed. If the buffer size is too small, the data may be fragmented or lost, resulting in poor performance or errors. If the buffer size is too large, the memory may be wasted or the data may be delayed, affecting the responsiveness or timeliness of the communication. In this blog post, I will explain how to set the buffer size for TCP socket programming in C++, and provide some examples of how to use the relevant functions and parameters. The buffer size for TCP socket programming in C++ can be set by using the setsockopt function, which allows the programmer to change the options for a socket. The setsockopt function has the following prototype: int setsockopt...

Example: A TCP Socket Echo Server in Python

Introduction TCP (Transmission Control Protocol) is one of the most widely used protocols in the Internet. It provides reliable, ordered, and error-checked delivery of data between applications running on different devices. A TCP socket is an endpoint of a TCP connection, which is identified by an IP address and a port number. A TCP socket can send and receive data to and from another TCP socket over the network. In this article, I will show you how to write a simple TCP socket echo server in Python, which is a program that listens for incoming connections from TCP socket clients, and echoes back whatever data it receives from them. This program can be useful for testing the functionality and performance of TCP sockets, as well as learning the basics of socket programming in Python. Requirements To write and run this program, you will need the following: - A computer with Python 3 installed. You can download Python 3 from [here]. - A text editor or an IDE (Integrated Development Enviro...

How to Capture and Modify TCP Packets Using Npcap Library in C

email:  tcpfast@gmail.com  In this blog post, I will show you how to use the pcap library in C to capture and modify TCP packets on the fly. The pcap library is a powerful tool for network analysis and manipulation, which allows you to access raw packets from various network interfaces. You can use the pcap library to implement your own network applications, such as firewalls, proxies, sniffers, etc. The Code The code I will use as an example is as follows: # include <stdio.h> # include <stdlib.h> # include <pcap.h> # include <Packet32.h> # include <ntddndis.h> # define MAX_PACKET_SIZE 65536 # define KEYWORD "keyword1" # define IP1 "192.168.0.1" # define PORT1 12345 void packet_handler (u_char* user_data, const struct pcap_pkthdr* pkthdr, const u_char* packet) ; int main () { pcap_t * handle; char errbuf[PCAP_ERRBUF_SIZE]; // Open the network adapter handle = pcap_open_live( "\\Device\\...