Ubuntu dnsmasq Configuration

Source: Internet
Author: User

I. Introduction

DNSmasq is a lightweight and easy-to-use DNS service tool. It can be used for NAT translation of IP addresses during Intranet and Internet connections, or as a DNS service for small networks.


Ii. Installation

Sudo apt-get install dnsmasq


Iii. Configuration

Vi/etc/dnsmasq. conf


# Change this line if you want dns to get its upstream servers from
# Somewhere other that/etc/resolv. conf
# Resolv-file =

Set the upper-level dns server to forward query requests to the upper-level server. If this parameter is not set,/etc/resolv. conf is used by default.

To resolve the Internet dns, you must set this option to forward dns requests to the Internet.



# Include a another lot of configuration options.
# Conf-file =/etc/dnsmasq. more. conf
Conf-dir =/etc/dnsmasq. d

Used to include the configuration file directory


Create a file configuration file in/etc/dnsmasq. d, such as a dns-intrant.conf


Address =/www.google.hk/192.168.1.12

# Wildcard Parsing

Address =/.google.hk/192.168.1.12
Address =/.google.net/192.168.1.12
Address =/.google.com/121.52.221.12


Common websites can be added for dns caching.

4. Start the service

Sudo service dnsmasq start


Netstat-ntlp | grep 53 check whether the service is started







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.