Use dnsmasq to build a small Intranet DNS

Source: Internet
Author: User

Using dnsmasq to build a small Intranet DNS dnsmasq is a very small dns server that can solve small-scale dns query problems, such as the Intranet of the IDC. The general idea of www.2cto.com is as follows: Configure dnsmasq as the DNS Cache Server and add local Intranet resolution to the/etc/hosts file, when querying an intranet machine, the hosts file is queried first. This means that/etc/hosts is shared to All Intranet machines for mutual identification. It is easier to edit the hosts file than to add bind DNS records. The implementation process uses CentOS 6 as an example to install and configure yum install dnsmasq-y service dnsmasq start. Replace the DNS of other machines with the IP address of dnsmasq. Next, you can edit the hosts file. You know, you can briefly list the file in the format of 127.0.0.1 localhost 192.168.1.10 web01.xxx.com web01 192.168.1.20 web02.xxx.com web02 hosts. The file is also powerful in hijacking resolution, for example, mirror.centos.org is where the CentOS warehouse is located. It is almost a domain name that the machine can normally access. I resolve it into an intranet address and build an intranet image site, not only Intranet machines can also get security updates in a timely manner, but also can save a lot of traffic every month. For other problems, the default configuration file is/etc/dnsmasq. conf. If it is commented out, it is either the example or the default value. Resolv is directly cached by default. nameserver in conf, specify other files with the following options: resolv-file =/etc/resolv. dnsmasq. conf www.2cto.com listens to all the local ports by default, and specifies the listening port (do not forget the local loopback) listen-address = 127.0.0.1, 192.168.1.56 I want to record the dns in another file, instead of/etc/hosts addn-hosts =/etc/addion_hosts, set the dns cache size cache-size = 150. I am worried about the stability of dnsmasq. solution 1: write a script or use nagios to monitor the dnsmasq process, or regularly restart solution 2: Set up a dnsmasq on another machine and copy the/etc/hosts file, specify two Intranet DNS servers on the client. Remember to open port 53 on the iptables firewall!

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.