Detailed explanation of static DNS configuration under Ubuntu system

1. Introduction of DNS service:

DNS (Domain Name Server, domain name server) is a server that converts a domain name (domain name) and its corresponding IP address (IP address). A table of domain names and corresponding IP addresses (IP addresses) is stored in DNS to resolve the domain names of messages.

Because the mimic storage system implemented in the laboratory needs to dynamically change the ip address, a dns server needs to be built, and the servers that need to query and change the ip address are bound 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 matter, you can directly modify the corresponding /etc/resolv.conf file. Just add or modify the ip address behind the nameserver. But I stupidly thought that this is the same setting under the Debian series (eg: Ubuntu, Mint), and it seems that it can be used even if it is changed, so I didn't study it carefully.

After a power outage and restart one day, the DNS service on the Ubuntu system collectively failed, and then the investigation found that the /etc/resolv.conf file was overwritten, and the originally configured dns information disappeared. As shown below:

Screenshot from 2017-11-13 08:24:46.png

囧rz! Ubuntu told you, DO NOT EDIT THIS FILE BY HAND - YOUR CHANGES WILL BE OVERWRITTEN.

2. System environment:

System platform: Ubuntu 14.04

Let's sort through the editing rules of resolv.conf under Ubuntu, and then we can sum up how to prescribe the right medicine to deal with the problem of static DNS configuration restart failure.

Process analysis:
  1. In the process of starting the network equipment of the Ubuntu system, the network interface will be initialized by the configuration file of /etc/network/interface, so the corresponding dns server will be written first when directly configured in /etc/network/interface Enter /etc/resolv.conf. So we can add the following content:
    dns-nameservers 180.76.76.76 //Support, Baidu's DNS server

Summary: The binding process of the Linux static DNS server under the Debian series of distributions has been sorted out in detail. We can use any of the above three methods. (囧rz, each method has a different syntax, cheating Linux) Of course, the RedHat series of distributions can refer to the above content, and the static configuration of the dns server process should be similar. If there are omissions, please give pointers.

Recommended Posts

Detailed explanation of static DNS configuration under Ubuntu system
Detailed explanation of static DNS configuration method in Ubuntu
Detailed explanation of quick installation and configuration of Subversion (SVN) under Ubuntu
Detailed explanation of Spark installation and configuration tutorial under centOS7
Network configuration under Ubuntu
Detailed explanation of Centos 7 system virtual machine bridging mode
Use of mediawiki under ubuntu
DNS service construction under Ubuntu
The process of solving the problem of installing ImageMagick under Ubuntu system
Detailed explanation of python backtracking template
Detailed explanation of python sequence types
Installation of deb package under Ubuntu
Overview of the Ubuntu file system
Detailed explanation of the installation and use of SSH in the Ubuntu environment
Detailed examples of Centos6 network configuration
Centos 7 RAID 5 detailed explanation and configuration
Installation of Docker CE under Ubuntu
How to extend the root directory of LVM under Ubuntu system
Coexistence of CUDA8.0 and CUDA9.0 under Ubuntu 16.04
Detailed explanation of Python IO port multiplexing
Install linux (ubuntu) dual system under windows system
Installation and configuration of redis under centos7
JDK environment variable configuration method under ubuntu
Installation and uninstallation of CUDA under Ubuntu 16.04
Detailed explanation of -u parameter of python command
Install utility software collection under Ubuntu system
Detailed explanation of Python guessing algorithm problems
DLNA/UPnP Server installation and configuration under Ubuntu 12.04
Ubuntu20.04 install Python3 virtual environment tutorial detailed explanation
Installation and configuration of JDK in CentOS 7 system
Detailed explanation of the principle of Python super() method
Windows10 install ubuntu20.04 dual system detailed graphic tutorial
Summary of methods to use Evernote under Ubuntu 14.04
CentOS 6.5 system installation and configuration graphic tutorial (detailed graphic)
Summary of Ubuntu system and privacy cleaning tools
Installation of pulseaudio and API usage under Ubuntu 12.04
Detailed explanation of python standard library OS module
The basic configuration and interface beautification of Ubuntu
Install the old version of seurat under Ubuntu
Detailed explanation of the usage of Python decimal module
Detailed explanation of how python supports concurrent methods
Installation and configuration of rsync server under CentOS 6.5
Kaldi installation and configuration graphic tutorials under Ubuntu
Detailed explanation of data types based on Python
Installation, configuration and uninstallation of GitLab in Ubuntu19.1
Detailed explanation of building Hadoop environment on CentOS 6.5
Explain the implementation of Centos8 static IP configuration
Distributed deployment of Apollo configuration center under CentOS8
Chromium is set as system setting under ubuntu 18.04