In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Brief introduction of DNS service:
DNS (Domain Name Server, domain name server) is a server that translates domain names (domain name) and corresponding IP addresses (IP address). A table of domain names (domain name) and corresponding IP addresses (IP address) is saved in DNS to resolve the domain name of the message.
Because the pseudo storage system implemented in the laboratory needs to change the ip address dynamically, it is necessary to build a dns server, and bind the servers that need to query the change of ip address to the same dns server. Usually in RedHat series (eg:Fedora,Centos) systems, when we need to change the dns server is a very simple thing, we can directly modify the corresponding / etc/resolv.conf file. Just add or modify the ip address after nameserver. But I foolishly thought that it was the same setting under the Debian series (eg:Ubuntu,Mint). It seemed that it could be used even if it was changed, so I didn't look into it.
After a power outage and restart one day, the DNS service on the Ubuntu system failed collectively, and then the investigation found that the / etc/resolv.conf file was overwritten and all the previously configured dns information disappeared. As shown in the following figure:
Embarrassing rz! Ubuntu told you everything, DO NOT EDIT THIS FILE BY HAND-- YOUR CHANGES WILL BE OVERWRITTEN.
System environment:
System platform: Ubuntu 14.04
Let's comb through the editing rules of resolv.conf under Ubuntu, and we can sum up how to deal with the failure of static dns configuration restart.
Process analysis:
1. In the process of starting the network device of the Ubuntu system, the network interface is initialized by relying on the configuration file of / etc/network/interface, so the corresponding dns server configured directly in / etc/network/interface will be written to / etc/resolv.conf first. So we can add the following to it:
Dns-nameservers 180.76.76.76 / / support, Baidu's DNS server
two。 Next, NetworkManager will relay to populate / etc/resolv.conf. Dependent configuration file / etc/NetworkManager/NetworkManager.conf We can also achieve the purpose of static dns configuration by modifying the dns entry in this configuration file:
Dns=119.29.29.29 / / DNS server of Tencent
3. If you miss the first two steps, it doesn't matter, we still have a chance to fix it. Next, resolv reads its own dns configuration file and writes to / etc/resolv.conf. The dependent configuration file is / etc/resolvconf/resolv.conf.d/tail. By adding a dns server, we can also write to our statically configured dns server.
Nameserver=223.5.5.5 / / Ali's DNS server
Static IP configuration
The network configuration information of Ubuntu is placed in / etc/network/interfaces. If the configuration acquires ip dynamically, add the following to the above file:
Open the network configuration information file using the following command:
Sudo gedit / etc/network/interfaces
Edit the file (check to see if your getway is correct. ):
Auto eth0 iface eth0 inet static address 192.168.8.119 netmask 255.255.255.0 gateway 192.168.8.1
Restart the network after the configuration is complete:
Sudo / etc/init.d/networking restart
At this time, you will view the modified configuration information.
Summary
We have combed the binding process of Linux static DNS server under the Debian series distribution in detail, and we can use any of the above three methods. (embarrassing rz, the syntax of each method is different, Linux.) of course, the distribution of the RedHat series can refer to the above, and the process of static configuration of dns servers should be more or less the same.
All right, that's all of this article. I hope the content of this article has a certain reference and learning value for everyone's study or work. If you have any questions, you can leave a message and exchange. Thank you for your support.
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.