Aliyun account: purchase a domain name in Aliyun and bind it to ECS server!!

cloud 2026-06-09 阅读 9
1

In the world of the Internet, IP addresses (e. g.

123.45.67.89

) is like the "GPS latitude and longitude coordinates" of the house, accurate but extremely difficult to remember. And

Domain name

(such

baidu.com

,

yourname.com

) is the "house number" of your house ".

When you buy an ECS cloud server in Aliyun and put the website code in it, it is obviously unrealistic to let the customer enter a string of cold digital IP to access it every time. What you need to do is to buy your own house number (domain name) and nail this house number to your ECS server IP through "domain name resolution (DNS).

Many people think that domain name resolution is a technical job, and when they hear the professional terms "A record", "CNAME" and "TTL", they are very big. In today's article, let's completely abandon the rigid mandarin of official documents and use the real-life style of pure vernacular to lead the way,

Hand in hand, take you through the whole process of purchasing domain name, real name authentication and perfectly binding to ECS server in ariyun.

.

The first stage: buy house number-domain name purchase and real name authentication

Alibaba Cloud account

If you have already bought a domain name, you can skip this step and go straight to the second stage. If not, please follow my rhythm:

1. Selection and purchase

Log in to the Alibaba Cloud official website and enter [Domain Name Registration] in the top search bar.

Enter the name you want (such as mycoolwebsite) in the query box and click Search.

The system will list a bunch of suffixes, such as. com (international, most recommended),. cn (China's national top-level domain name),. net, etc.

Pick one that has not been registered by others and the renewal price is appropriate, and click [join list] -> [buy now].

2. Core card point: real name authentication (cannot be resolved without passing)

According to the domestic network security regulations, after the purchase of domain name

Real-name authentication is required

Otherwise, the domain name will be locked by the registry (ClientHold state) and cannot be resolved at all.

Personal Purchase: You need to upload photos of the front and back of your ID card.

Enterprise Buy: Need to upload the company's business license.

Live Experience: Alibaba Cloud's automated audit is now very fast, usually within 10 minutes to 1 hour after submission. After buying the domain name, go to the domain name console to see if the status has changed to "normal" or "real name".

The second stage: to open up the channel-domain name resolution of the hard core practice.

The real name of the domain name has been passed, and the ECS server has been opened. The next step is the core "binding" link of the whole article.

1. Find the parsing entry

Log in to the Alibaba Cloud console. In the left-side menu bar or search bar, find [Alibaba Cloud DNS].

After entering, you will see the domain name you just bought in the "domain name resolution" list.

Click the blue [Resolution Settings] on the right side of the domain name.

2. Add the key "two records"

Click

[Add Record]

Button. To make your site regardless of user input

yourname.com

Still

www.yourname.com

Can be opened normally, we must add the following two basic analysis records.

First: Configure "www" access (for example:)

Record Type: Select A record (A record means "point the domain name to an IPv4 address").

Host Record: Enter www.

Resolution Line: Select Default.

Record value: extremely important! Fill in the "public network IP" of your Aliyun ECS server here (go to the ECS console to copy the external network IP, do not fill in the internal network IP).

TTL: Keep the default 10 minutes (refers to the DNS cache update time).

Article 2: Configure direct access without www (e. g. yourname.com)

Many people are used to entering the domain name directly without typing www. In order to prevent this from opening the web page, we need to add another one:

Record Type: A record is still selected.

Host record: Enter @(@ represents the primary domain name itself in DNS).

Alibaba Cloud account

Resolution Line: Select Default.

Record Value: Also fill in the public IP of your ECS server.

TTL: Keep the default.

After adding two records, click Save. At this time, you will see two A records in the list, one horizontal and one vertical.

The third stage: back-end connection-"claim" domain name on ECS server

Big pit warning:

Many newcomers thought that they were done by filling in IP in cloud resolution. As a result, they rushed to type the domain name in the browser and found that the default page of "inaccessible" or "Welcome to Nginx" was still displayed.

Why? Because although your domain name has touched the door of the ECS server along the network, the Web software (such as Nginx or Apache) installed in the server is still confused. It doesn't know who this domain name is. You must "open the door" in the server's configuration file ".

to the most commonly used

Nginx

For example, you need to modify the website's virtual host configuration file (usually in.

/etc/nginx/conf.d/

directory):

Bash

# Open your website profile with the vi editor

vi /etc/nginx/conf.d/yourwebsite.conf

In

server

In the block, find

server name

In this line, change it to the domain name you just bound:

Nginx

server {

listen 80;

# Core: Write your domain name word for word here. Multiple domain names are separated by spaces.

server_n

ame yourname.com www.yourname.com;

root /usr/share/nginx/html;# The directory in which your website code is stored

index index.html index.php;

location / {

try_files $uri $uri/ =404;

}

}

Save Exit (

:wq

), and then let Nginx reload the configuration:

Bash

nginx -s reload

Stage 4: Ultimate Verification and Pit Avoidance Guide

Everything is configured properly, how to verify whether the resolution is really effective?

1. Official Test Method: Ping Command

Open a terminal (Mac) or command prompt (Windows cmd) on your computer (not the server, but your own computer for daily use) and type:

Bash

ping www.yourname.com

If the IP address returned on the screen,

It happens to be the public IP of your Aliyun ECS

, and have time to respond (such

time=15ms

), indicating that the analysis has been completely passed on the physical network!

2. Check common card points (why can't I open it after I have configured it?)

Card Point 1: Global DNS Effective Delay: Although Aliyun resolution takes effect in seconds, it takes time for telecom, Unicom and mobile operators around the world to refresh their DNS caches. It usually takes 1 to 10 minutes to wait, and in rare cases it may take several hours. Don't worry, let the bullets fly for a while.

Card 2: Aliyun security group has not released (the most common ghost wall): if you Ping the domain name is right, but the browser cannot open it in circles. 99% of the reasons are that you have not allowed port 80 (HTTP) or port 443 (HTTPS) in the [security group] of ariyun ECS console. The server closed the door and the domain name couldn't get in again.

Card 3: Domain Name Not Registered (Unique to Domestic Computer Rooms): If your ECS server is bought in mainland China (such as Beijing, Shanghai, Hangzhou, etc.), as soon as you resolve the domain name, a large Aliyun warning page will pop up within a few minutes, prompting you that "the website is not registered". Solution: If the server is in China, you must click [Filing] in the background of Aliyun, submit the information according to the prompt, and wait for the Ministry of Industry and Information Technology to review and obtain the number (usually it takes 1-2 weeks). During this time, the site is not publicly accessible. If you don't want to file, the only way is to buy the server in Hong Kong or overseas regions.

Summary

The whole process of domain name resolution is, to put it bluntly, three steps:

Write the address of the server on the domain name side (cloud resolution a record) -> write the name of the domain name in the server

Word (Modify Web Configuration) -> Open the security door of the server (Release Security Group).

After straightening out this logic, you can be as familiar as a senior operator, whether you change servers, do enterprise email analysis, or add secondary domain names. Hurry to hang up your exclusive house number and let users around the world find your website along the domain name!

Alibaba Cloud account

2
← 返回新闻中心