There are four main ways to set up a DNS name server in Ubuntu:
First, set the global static DNS
$ sudo vi/etc/resolvconf/resolv.conf.d/base (this file is empty by default), insert:
NameServer x.x.x.x
NameServer Y.Y.Y.Y
If there are multiple DNS on one line, modify the save and then execute
$ sudo resolvconf-u
Look at/etc/resolv.conf, the bottom is more than 2 lines:
$ cat/etc/resolv.conf
# Dynamic resolv.conf (5) file for glibc resolver (3) generated by resolvconf (8)
# do not EDIT this FILE by HAND--YOUR changes'll be overwritten
NameServer 8.8.8.8
NameServer 8.8.4.4
Then ping a domain name, then you can parse it, without restarting.
Ii. setting up DNS in the interface configuration file
By/etc/network/interfaces, add a sentence at the end of it:
Dns-nameservers 8.8.8.8
8.8.8.8 is a DNS service provided by Google, just to cite an example, you can also change to the DNS of the carrier. Restart after the DNS is in effect, at this time to see/etc/resolv.conf, the bottom of the more than one line:
# Dynamic resolv.conf (5) file for glibc resolver (3) generated by resolvconf (8)
# do not EDIT this FILE by HAND--YOUR changes'll be overwritten
NameServer 8.8.8.8
Third, through the Network-manager graphical interface settings
If a desktop system such as GNOME is installed, it can be set directly from the NM (Network-manager) of the pallet area, such as:
Iv. Temporary Configuration method
Modify/etc/resolv.conf directly
$sudo vim/etc/resolv.conf
# Dynamic resolv.conf (5) file for glibc resolver (3) generated by resolvconf (8)
# do not EDIT this FILE by HAND--YOUR changes'll be overwritten
NameServer 8.8.8.8
Note: The comment at the beginning of the file indicates that the file was created dynamically by the RESOLVCONF program and not edited directly, and the modifications will be overwritten.
This article was tested under Ubuntu Kylin 14.04.
=-=-=-=-=
Powered by Blogilo
Set up DNS domain name server in Ubuntu