Set up DNS domain name server in Ubuntu

Source: Internet
Author: User
Tags domain name server nameserver

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.