In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Preparation before the case: the VMware virtual machine needs to be installed on the computer, and a link is attached here for experimental download:
Link: https://pan.baidu.com/s/1V06orbCIXc7IY6oNNscJiQ extraction code: ejii
Before we start a case, we need to know what DNS is:
DNS domain name system (Domain Name System, abbreviated as DNS) is a service of the Internet. As a distributed database that maps domain names and IP addresses to each other, it makes it more convenient for people to access the Internet. DNS uses TCP and UDP port 53 [1]. Currently, the limit for the length of each first-level domain name is 63 characters, and the total length of a domain name cannot exceed 253 characters.
Initially, the characters of the domain name are limited to a subset of ASCII characters. In 2008, ICANN passed a resolution allowing other languages to be used as characters for Internet top-level domain names. Using an IDNA system based on Punycode, you can map Unicode strings to a valid DNS character set. Therefore, domain names such as "XXX. China" and "XXX. USA" can be entered and accessed directly in the address bar without the need to install plug-ins. However, due to the wide use of English, using characters from other languages as domain names will cause a variety of problems, such as difficult to enter, difficult to promote internationally, and so on.
To put it simply, it is a system that translates domain names into IP addresses.
Deploy the DNS service:
In the early days, HOSTS files were used to resolve domain names: the path of this file in the computer is shown in the following figure
You can see the hosts file in the folder of the last etc.
However, it was later changed to DNS resolution domain name due to the following two reasons:
Duplicate host names are difficult to maintain
DNS's domain name system is distributed and hierarchical, which is much more convenient than HOSTS.
Let's take a look at the structure of domain name space:
Root domain (top-level) top-level domain (category division, for example: organizational domain, country domain name) second-level domain name FQDN (Fully Qualified Domain Name fully qualified domain name: name with both host name and domain name)
The structure diagram is shown in the following figure
Let's give an example of decomposition:
According to our most common www.baidu.com. For example: the "." after com. It was hidden when we actually visited the web page, this "." The root domain com is the top-level domain baidu, which is the second-level domain name, www is the host name.
When you run cmd, enter the instruction Ping www.baidu.com to get an IP address as shown in the figure:
At this time, we enter this IP address into the address bar in the browser and click enter to enter Baidu's home page. The following figure shows the operation result:
The above experiment is to visit the corresponding server web page through the IP address.
Let's talk about the classification of DNS servers:
Primary name server: the DNS server that stores the relevant settings in this zone
It stores the original data of the zone file, auxiliary name server: copying data from other servers
Data for replica cannot be modified master name server: provide DNS server that tends to data replication Cache-Only name server: store queried data in cache
Next, let's take a look at the query process of DNS: www.benet.com as shown in the following figure
At this time, we can use an instruction to resolve the domain name to see what the DNS address of Baidu is:
We enter the instruction nslookup www.baidu.com in cmd. You can get the domain name 192.168.0.1
Let's go into the preparatory steps before the construction of DNS:
We use Server2016 as the DNS server and Win10 as the client PC
Enter the Ssever2016 system in the virtual machine and set the Nic mode to host only:
At the same time, it must be noted that in the virtual network editor of the virtual machine, the DHCP option under the name VMnet1 cannot be checked.
At this point, we enter the Win10 system in the virtual machine, and set the network card mode to host only: (at the same time, run the two on the VMnet1 physical machine, so that we can communicate with each other)
At this time, we go back to Server2016 to set the network IP address.
Enter the Win10 system again to set the network IP address. Here are some points to pay attention to:
1. It needs to be on the same network segment as the IP address of Server2016, that is, 192.168.100.
two。 The address of the preferred DNS server is the address of Server2016, that is, 192.168.100.100, as shown in the following figure
At this time, we check whether the network is interconnected, use cmd under the Win10 system, and enter the instruction: Ping 192.168.100.100. This is because the firewall is not turned off and can be interconnected after the firewall is turned off. The specific operation is shown below:
Next, let's build the DNS:
Enter the server2016 system and select Service Manager from the start menu. After the dashboard interface has been loaded:
Click add roles and Features Click next Select role-based or feature-based installation Click next Select Server from Server Pool Click next Server role Select DNS Server Click add function Click next you do not need to check other functions Click next Click install wait for the installation to finish. At this time we can find the newly added DNS in the Windows Management tool in the start menu.
The following is an illustration of the steps that need to be paid attention to in the steps
Click on the created DNS server, and let's create a query mechanism in this server
Select the forward query area in the server interface, right-click on the new area to enter the new area wizard: click next to select the region type as the main area, click the next step to set the region name, for example: yun.com click on the next region file, create a new file by default, you can click the next dynamic update, keep the default does not allow dynamic update, click next click finish, then the region is created. The interface is shown in the following figure:
At this time, our domain name is only yun.com, and the host name www is missing. Then we do the following
After entering, the domain name is entered by default. Enter www for the name, and the following locked domain name will be automatically added with www, and then enter the corresponding IP address: 192.168.100.100. After resolving yourself, you only need to set up a website on this server to enter www.yun.com directly. The operation results are as follows:
After we have this record, let's go to the Win10 system and see if we can parse it:
Enter nslookup www.yun.com in cmd, and if you can parse, the result should be 192.168.100.100
The experimental results are shown in the following figure:
The above DNS host building experiment is successful.
Next, let's go into setting up a Web virtual host.
1. Different IP: there are two network cards on one server
To enter the server2016 system, because there are multiple network cards, there is only one network card, so you need to add one network card as shown below:
Next, configure the newly generated second Nic as follows:
Click OK at this time to jump out of the prompt box and click OK directly. Enter the properties of the network card to see whether the IP address in IPv4 is successfully configured. After confirming that there is no problem, it is recommended to restart the Server2016 system in the virtual machine to make the newly set content take effect. After reboot, enter the system as an administrator, call out cmd, and enter the instruction ipconfig to obtain the IP address. The result is as follows:
Both will take effect as soon as they appear, and then we can take the next step, building a website.
Click the start menu, select the service manager, click to enter the service manager dashboard full load interface, click to add roles and functions, click next to enter the server role, select Web server, add IIS management tools, click add functions, click next, no other features need to be added, click next. After installation is successful, you can find the following options in the Windows management tools in the start menu:
Enter this console to get the following interface: (site is provided by default)
Let's bind the website as shown below:
Before making the basic settings of the website, we can create a new website path. Let's do the following:
Call out cmd as an administrator in the Server2016 system, enter the instruction: e: enter the E disk at this time, and then enter mkdir yun bigdata (this is a quick way to create a new folder). At this time, two new folders, yun and bigdata, will appear on the E disk on the computer. The creation steps and results are as follows:
After opening the notepad, you can see that the content displayed is "this is yun web".
At this time, call up cmd again, enter the instruction: cd bigdata enter this folder, and then enter: echo "thisi is bigdata web" > index.html, then get the same result as above, enter the path to open the file selection notepad, and get the display content as "this is bigdata web". At this time, the marks of the two websites have been successfully created.
At this point, we go to the IIS manager, make the basic settings of the website, click Edit, and select the site path as E:\ yun. The operation process and results are as follows:
After setting up, we go to the Win10 client and enter the browser to try to see if it is successful. Enter the address: 192.168.100.100 in the search bar, and the result will display "this is yun web". The result is as follows:
At this time, we still have a new bigdata website to be built. Let's learn how to create a new website.
Step 1: go to the IIS manager of the Server2016 system, right-click the website, and select add website.
After the setting is completed, enter the Win10 system browser, enter the address 192.168.100.110 in the search bar and click enter, and the accessible interface is displayed as "this is bigdata web". At this time, the two websites with different IP are successful.
two。 Same IP, different port
At this point, we enter the server2016 system and go to the IIS manager. In the binding editing of the website yun, we can see that when the IP address is 192.168.100.100, the port is 80, as shown below:
In the binding editing of bigdata, we need to change the IP address to 192.168.100.100 for the same IP and 8080 for different ports, as shown in the following figure:
After adjustment, we enter the Win10 system, open 192.168.100.100 with a browser, and the interface shows "this is yun web". In the search bar, we type: 192.168.100.100 this is bigdata web 8080 and hit enter, and the interface shows "this is bigdata web".
The above operations are based on the same IP and different ports
③ same IP, same port, different hostname
At this point, we enter the server2016 system, go to the IIS manager, and set the host name: www.yun.com in the binding edit of the yun website, as follows:
When you enter the binding editing of the website bigdata, the same IP remains unchanged by default, and the same port is changed to 80 here. Set the host name to: www.bigdata.com, and do the following:
But at this point, it should be noted that we only set the parsing host of www.yun.com in the DNS server, but not the parsing host of bigdata, so here we need to create a parsing host of www.bigdata.com in the DNS server according to the new zone of yun.com (see the operation mode of yun.com above). In this case, the difference between the two websites is the host name.
At this time, we enter the Win10 system, verify it with a browser, and enter www.yun.com or www.bigdata.com in the search bar to get the corresponding "this is yun web" and "this is bigdata web" as shown in the following figure:
At this time, if we enter the IP address in the browser's address search bar, there will be a NOT FOUND 404 error.
As shown in the following figure:
Let's combine the previous DHCP:
The manually assigned IP address set in the Win10 client system is now assigned automatically, as shown in the following figure:
Then follow the procedure in the last created article and click add roles and functions in the Service Manager. Next, select DHCP, and then click install by default. At this time, DHCP, DNS and WEB will exist on the server at the same time.
At this time, in the windows management tools in the start menu, find the DHCP console, click Open, and right-click IPv4 to select New scope.
Enter the wizard, 1. Click next, and the functional domain name is: yun.
two。 Click the next address range: start IP address 192.168.100.50 end IP address 192. 168.100.80 Click next exclude address: do not set it for the time being
3. Click next. The lease term defaults to 8 days.
4. Click the next DHCP option to start the configuration.
5. Click the next gateway IP: example 192.168.100.1, and click add
6. Click the next domain name and DNS server, enter the IP address 192.168.100.100 (this address is to be assigned to the following client, and the client is to apply this address), click add and automatically search for DNS. Because DNS has been built before, it will be automatically added without any prompt.
7. Click next. WINS server does not need to be set
8. Click next to activate now. Next, finish.
By this time, the scope of yun has been created. When we enter the WIN10 system, run cmd, and enter the instruction: ipconfig / renew to obtain the IP address of 192.168.100.50. The result is as follows:
Enter the command again: ipconfig / all, and see that both the DNS address and the DHCP address are 192.168.100.100. The result is as follows:
At this time, we go back to the WIN10 system to verify with the browser, and enter www.yun.com and www.bigdata.com respectively to get the correct website interface "this is yun web" and "this is bigdata web". This experiment is successful, reflecting a small architecture based on DHCP, DNS and WEB.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.