DNS domain name resolution, and instructions for A, AAAA, CNAME, MX, NS, TXT, SRV, SOA, and PTR

To review the past and learn the new, I recently came across relevant articles on the Internet. I will record them here for your reference.

Table of contents

1.A record

2、CNAME:

Two domain name resolution methods

4. NS records

5. TXT record:

6. AAAA record:

7. SRV record:

8. SOA records:

9. PTR record:

10. Related instructions

11. Some problems in DNS resolution

11.1 A record and CNAME record

11.2 A records and AAAA records

11.3 IPv4 and IPv6

11.4 TTL value

12. Check DNS methods (dig, nslookup tools)

reference:


1. A record

        The A (Address) record is used to specify the IP address record corresponding to the host name (or domain name). Users can point the website server under this domain name to their own web server. You can also set the second-level domain name of your domain name.

        Also known as IP pointing, users can set a subdomain name here and point it to their own target host address, thereby finding the server through the domain name.
        Note: ·The pointed target host address type can only use IP address;

1) Add A record

        Fill in the name of the subdomain in "Host Name", "Type" is A, fill in the IP address of the web server in "IP Address/Host Name", and click the "Add" button.

        Note: If the "Host Name" column is empty, it means pointing to the domain name mydomain.com itself.

2) To modify the A record,
        just change the original IP address directly to the new IP address in the "IP Address/Host Name" column, and then click the "Modify" button.

3) To delete an A record
        , click the corresponding "Delete" button behind the A record you want to delete.

4) Pan-domain name resolution
        refers to all unspecified subdomain names of the domain name pointing to one space.
Fill in * in "Host Name", "Type" is A, fill in the IP address of the web server in "IP Address/Host Name", and click the "Add" button.

5) Implementation of load balancing:
        Load balancing (Server Load Balancing, SLB) refers to dynamically distributing network load on a series of resources. Load balancing can reduce network congestion, improve overall network performance, improve self-healing, and ensure the availability of enterprise-critical applications.
When the same subdomain name has multiple target addresses, it means round robin, which can achieve the purpose of load balancing, but it requires the support of the virtual host service provider.

2、CNAME:

        CNAME (Canonical name) is: alias record. This type of record allows you to map multiple names to the same computer. Usually used for computers that provide both WWW and MAIL services.

        For example, there is a computer named "host.mydomain.com" (A record). It provides both WWW and MAIL services in order to facilitate users to access services. Two aliases (CNAME) can be set for this computer: WWW and MAIL. The full names of these two aliases are www.mydomain.com and "mail.mydomain.com". Actually they all point to "host.mydomain.com".
  It can be understood like this:

  • Alias: www.mydomain.com Points to host name: host.mydomain.com Points to host IP: 127.0.0.1
  • Alias: mail.mydomain.com Points to host name: host.mydomain.com Points to host IP: 127.0.0.1

  The host IP above is an assumption for easier understanding. When entering the aliases www.mydomain.com and mail.mydomain.com in the browser, it is equivalent to entering the host name host.mydomain.com, which is also equivalent to entering the host IP127.0.0.1. CNAME records are the process of pointing (mapping) aliases to host names.

-----------------------
        CNAME is usually called an alias to point to. You can set an alias for a host. For example, if you set test.mydomain.com to point to a host www.linkesky.com, you can use test.mydomain.com to access www.linkesky.com in the future.
illustrate:

  • -The target host address of CNAME can only use the host name, not the IP address;
  • - There cannot be any other prefix before the host name, such as: http://, etc. are not allowed;
  • -A records take precedence over CNAME records. That is, if a host address has both an A record and a CNAME record, the CNAME record will not take effect.

1) To add a CNAME record
        , fill in the name of the subdomain in "Host Name", "Type" as CNAME, fill in the target address in "IP Address/Host Name", and click the "Add" button.

2) To modify the CNAME record,
        just change the original target address directly to the new address in the "IP Address/Host Name" column, and then click the "Modify" button.

3) To delete a CNAME record
        , click the corresponding "Delete" button behind the CNAME record you want to delete.

Two domain name resolution methods

        The two most common domain name resolution methods are A record domain name resolution and CNAME domain name resolution . ALB provides external domain names and only supports CNAME domain name resolution.

  • A record domain name resolution

    A record domain name resolution is also called IP pointing. You can set a subdomain name and point it to your own target host IP, so as to find the specified IP through the domain name. Application load balancing ALB provides public IP access to the outside world by default. If you need to access the host through a domain name, you can configure A record domain name resolution. The specific implementation plan is shown in the figure below:

  • CNAME domain name resolution

    CNAME domain name resolution is also called alias resolution. You can set a subdomain name and point it to other domain names, thereby pointing one domain name to another domain name. Application load balancing ALB provides external domain name access by default. If you access through other domain names, please configure CNAME domain name resolution. The specific implementation plan is shown in the figure below:

3. MX records :

        MX (Mail exchanger) mail routing record, users can point the mail server under the domain name to their own mail server, and then control all mailbox settings by themselves. You only need to fill in the IP address of your server online, and all emails under your domain name will be transferred to the corresponding mail server you set.
        Email exchange records. Used to point emails ending with this domain name to the corresponding mail server for processing. For example, if the user's email ends with the domain name mydomain.com, you need to add the MX record of the domain name in the management interface to process all emails ending with @mydomain.com.
illustrate:

  • ·MX records can use hostnames or IP addresses;
  • ·MX records can be set up as primary and secondary servers by setting priorities. The smaller the number in "Priority" means the higher the level. You can also use the same priority to achieve load balancing;
  • ·If you fill in a subdomain name in "Host Name", this MX record will only take effect for the subdomain name.

1) Add an MX record. The
"Host Name" column is empty, the "Type" is MX, fill in the target address or IP in "IP Address/Host Name", fill in a number in "Priority" (must be an integer), click Just click the "Add" button.

2) Modify the MX record.
Just modify the original target address or IP directly to a new address or IP in the "IP Address/Host Name" column, and then click the "Modify" button.

3) Delete MX records.
Click the corresponding "Delete" button behind the MX records you want to delete.

4) Load Balancing
Server Load Balancing (SLB) refers to intelligently distributing network load on a series of resources. Load balancing can reduce network congestion, improve overall network performance, improve self-healing, and ensure the availability of enterprise-critical applications.
When the MX record of a domain name has multiple target addresses with the same priority, it means round robin, which can achieve the purpose of load balancing, but requires the support of the email service provider.

4. NS records

        Parse server records. Used to indicate which server resolves the domain name. The NS records here only take effect for subdomain names. For example, if the user wants news.mydomain.com to be resolved by the server 12.34.56.78, the NS record of news.mydomain.com needs to be set.
illustrate:

  • ·The smaller the number in "Priority" means the higher the level;
  • ·You can fill in either the IP address or a host address like ns.mydomain.com in "IP address/host name", but you must ensure that the host address is valid. For example, point the NS record of news.mydomain.com to ns.mydomain.com. When setting the NS record, you also need to set the point of ns.mydomain.com, otherwise the NS record will not be parsed normally;
  • ·NS records take precedence over A records. That is, if a host address has both an NS record and an A record, the A record will not take effect. The NS records here only take effect for subdomain names.

1) Add NS record
        , fill in the name of the subdomain in "Host Name", "Type" is NS, fill in the IP address or name of the resolution server (such as ns.mydomain.com) in "IP Address/Host Name", Just click the "Add" button.

2) To modify the NS record,
        just change the original server target address or IP directly to the new address or IP in the "IP Address/Host Name" column, and then click the "Modify" button.

3) To delete an NS record
        , click the corresponding "Delete" button behind the NS record you want to delete.

5. TXT record :

        It can be filled in arbitrarily or left blank. This item is generally used when making some verification records, such as: making SPF (anti-spam) records

6. AAAA record :

        To point the hostname (or domain name) to an IPv6 address (for example: ff03:0:0:0:0:0:0:c1), you need to add an AAAA record

7. SRV record :

        This item is added when adding a service record. The SRV records which computer provides which service. The format is: service name.Protocol type (for example: _example-server._tcp).

8. SOA records :

        SOA is called the starting authority record. NS is used to identify multiple domain name resolution servers. SOA records are used to determine which one of the many NS records is the main server.

9. PTR record :

         The PTR record is the reverse record of the A record, also known as the IP reverse lookup record or pointer record. It is responsible for reversely parsing the IP into a domain name.

Explicit URL forwarding record: Point the domain name to a http(s)protocol address, and when accessing the domain name, it will automatically jump to the target address. For example: after explicitly forwarding www.liuht.cn to www.itbilu.com, when accessing www.liuht.cn, the address displayed in the address bar is: www.itbilu.com.

        Implicit UR forwarding record L: Point the domain name to a http(s)protocol address. When accessing the domain name, it will automatically jump to the target address. Implicit forwarding will hide the real target address. For example: after explicitly forwarding www.liuht.cn to www.itbilu.com, when accessing www.liuht.cn, the address displayed in the address bar is still: www.liuht.cn.

10. Related instructions

1) Load Balancing
        Server Load Balancing (SLB) refers to intelligently distributing network load on a series of resources. Load balancing can reduce network congestion, improve overall network performance, improve self-healing, and ensure the availability of enterprise-critical applications.
When the same subdomain has multiple target addresses, or the MX record of the domain name has multiple target addresses with the same priority, it means round robin, which can achieve the purpose of load balancing, but requires the support of the virtual host and email service provider.

2)  TTL value
        The full name of TTL value is "Time To Live". Simply put, it represents the cache time of DNS records on the DNS server. Many IDC DNS servers take effect immediately by default, and customers' additions and modifications generally take no more than 15 minutes to be used.

6. TXT record

        TXT record, generally refers to the description set for a certain host name or domain name, such as:

admin IN TXT “Administrator, phone number: 13xxx888″
mail IN TXT “Post office information company”
ljpbin IN TXT “contact: [email protected]

That is, you can set up TXT so that others can contact you.

  An important role of TXT records is to set SPF records to prevent emails sent by your mail server from being treated as spam.

  SPF is a type of DNS record proposed to prevent spam. It is a TXT type record that is used to register all IP addresses owned by a domain name that are used to send outgoing emails. For example:

dnspod.com text = “v=spf1 include:aspmx.googlemail.com ~all”
qq.com text = “v=spf1 ip4:119.147.10.0/23 ip4:119.147.18.0/24 ip4:222.202.96.0/24 ip4:64.71.138.0/25 ip4:58.251.149.0/24 ip4:119.147.6.0/24 ~all”

  Adding a TXT type record to the DNS record in the SPF format will improve the credibility of the domain name and prevent spam from forging senders of this domain to send spam. SPF is a technology related to DNS, and its content is written in the txt type record of DNS. The function of the mx record is to indicate to the sender which mail servers are available for a certain domain name. The function of SPF is opposite to that of mx. It indicates to the recipient which mail servers are authorized to send emails through a certain domain name. It can be seen from the definition that the main function of SPF is to fight spam, mainly targeting spam where the sender forges a domain name.

11. Some problems in DNS resolution

11.1  A记录andCNAME记录

   A记录It resolves a domain name to an IP address, CNAME记录but resolves the domain name to another domain name, and this domain name will eventually point to an A record. A记录There CNAME记录is no difference in functional implementation.

   CNAME记录It is more convenient when making IP address changes A记录. CNAME记录Allows multiple names to be mapped to the same computer. When multiple domain names need to point to the same server IP, you can make an A record for one domain name to point to the server IP, and then make other domain names aliases (i.e.: CNAME) to the A records. on the domain name. When the server IP address changes, you only need to change the domain name in the A record to the new IP. Other aliased domain names will be automatically changed to the new IP address without having to change each domain name.

11.2  A记录andAAAA记录

        Both point to an IP address, but the corresponding IP versions are different. A记录Point to IPv4address, AAAA记录point to IPv6address. AAAA记录Yes A记录upgraded version.

11.3  IPv4andIPv6

  IPv4, is the fourth version of the Internet Protocol (IP) and the first widely used version. It is the basic protocol that forms the basis of today's Internet technology. IPv4 The next version is IPv6, in the future, will replace the currently widely used one IPv4.

   IPv4The IP address length is stipulated in 32 bits (divided according to the TCP/IP reference model), that is, there are 2^32-1 addresses. IPv6It was first proposed to solve IPv4the problem that the address space will be exhausted with the rapid development of the Internet. In order to expand the address space, IPv6the length of the IP address was increased from 32 bits to 128 bits. IPv6In addition to solving the address shortage problem once and for all, the design IPv4process of wait.

11.4  TTLvalue

   TTL- Time To Live, which represents the cache time of the parsing record in the DNS server. The TTLunit of time is seconds, which is generally 3600 seconds. For example: when accessing www.itbilu.com, if there is no such record in the cache of the DNS server, a request will be made to an NS server. After obtaining the record, the record will be saved on the DNS server for the length of time. During the validity period TTL, TTLthe www.itbilu.comDNS The server will directly return the previous record from the cache.

12. Check DNS methods (dig, nslookup tools)

        First check whether the domain name is successfully created in the domain name management of the CDN. If it has been created successfully and CNAME resolution has been added according to the steps, but the resource external links cannot be accessed normally or the "Waiting for CNAME" status remains, you can detect the local domain name through the following method Domain name resolution, if the domain name is not successfully created for a long time, you can submit a work order for processing.

 You can use nslookup to check whether the domain name is resolved to the CNAME value of your accelerated domain name.

  • For linux/mac systems, you can use the command as shown in the figure  dig 您的加速域名 to check whether the first line resolves to the CNAME value you configured.

  • In windows system, you can open the "Start" menu through Win+R or click the "Start" button in the lower left corner, open "Run", enter cmd and press Enter.
    Enter in command line mode nslookup 您的加速域名, for example nslookup qn.vinchi.club, and you can see the cname value you copied in the results.

reference:

Set up CNAME domain name resolution - load balancing - Alibaba Cloud

How to configure the CNAME of a domain name - Qiniu Developer Center

Domain name resolution type: A record, CNAME, MX record, NS record, TTL, TXT record_txt record type_Oooover's blog-CSDN blog

Guess you like

Origin blog.csdn.net/yangyangye/article/details/130644687