DNS resolution

DNS Domain Name System is the abbreviated form of the so-called Domain Name System, which is an Internet service. It acts as a distributed database of domain names and IP addresses will be mapped each other, it can make it easier to access the Internet.

If you want to visit a Web site (such as www.example.com), your computer needs to know where the server on the Internet. In other words, it must know which IP address to dialogue with.

IP address of the computer to find the way to the Domain Name System (Domain Name System, namely DNS).

    

 

 

When registering a domain name, you can set many types of DNS records.

Each record contains a the Type (type), a Host (host) and a the Value (value).

  • "Type" are some predefined value.

  • "Host" represents the root (@) or subdomains (www).

  • "Value" is the IP or URL, or other values.

    

 

 

A record is responsible for mapping the sub-domain names into IPv4 addresses.

A local record is the most commonly used root (@), it can tell the location of example.com browser. AAAA record of action is the same, except for IPv6.

    

 

 

CNAME is responsible for mapping the sub-domain to another domain.

This can be another sub-domain on the same site (eg www will be forwarded to the root), may also be other applications where the domain name (for example heroku).

    

But CNAME there is a problem!

Once the sub-domain (host) is defined as a CNAME record, you can not define another record for the subdomain.

To do this, you can not use the CNAME at the root level (because the roots need to define other types of records).

    

To solve this problem, we can use the ALIAS (sometimes ANAME).

ALIAS the CNAME same effect, but it is non-standard DNS type.

Therefore, you can use the ALIAS root domain name (example.com) forwarded to the application server (example.herokudns.com).

    

 

 

In this way, you can record on the other root, for example:

TXT records can provide additional information to any computer reads the DNS records.

TXT records are often used to prove that you own the domain name, because only the owner of the domain name to set up DNS records.

    

and also:

MX records (e-mail eXchange), it can be used to specify another handle e-mail server (such as Google).

MX记录是唯一的,如果你需要设置多个服务器,那么就必须给每个服务器设置“优先级”。

    

还有许多其他的记录类型,但上述这些记录类型是你最经常设置的类型。

你还可以指定每条记录的存活时间(Time To Live,TTL),它可以告诉DNS服务器你的DNS值需要保存多久。

    

我们之所以设置存活时间,是因为新的域名记录需要一定的时间才能“传播”。

DNS服务器、你的ISP甚至你的计算机都会缓存DNS记录,提供“旧”值,直到存活时间到期。

    

 

 

希望在下一次设置DNS时,你能够扫清心中的疑惑!感谢您的阅读!

原文:https://dev.to/chrisachard/dns-record-crash-course-for-web-developers-35hn

 

 

Guess you like

Origin www.cnblogs.com/qiuyu666/p/11883619.html