The DNS and DHCP software used in Linux generally adopt isc bind and dhcpd. in most environments, these two software are indeed great and safe. But when we use a network environment like home or office, it may be more appropriate to replace them with smaller software. This section describes the software dnsmasq that can provide both DNS and DHCP services In Ubuntu. It can cache external DNS records and provide local DNS resolution or act as a proxy for external DNS. In addition, dns
The DNS and DHCP software used in Linux generally adopt isc bind and dhcpd. in most environments, these two software are indeed great and safe. But when we use a network environment like home or office, it may be more appropriate to replace them with smaller software.
This section describes the software dnsmasq that can provide both DNS and DHCP services In Ubuntu. It can cache external DNS records and provide local DNS resolution or act as a proxy for external DNS. In addition, the DHCP service provided by dnsmasq is similar to that provided by dhcpd. For example, for Dynamic Address Allocation, You can pre-specify a static IP address to a specific host through the MAC address.
1. Install dnsmasq (SEE)
Sudo apt-get install dnsmasq
Linuxidc @ linuxidc-laptop :~ $ Sudo apt-get install dnsmasq
[Sudo] password for linuxidc:
Reading the package list... complete
Analyzing the dependency tree of the software package
Reading status information... complete
The following software packages are automatically installed and are no longer in use:
Linux-headers-2.6.27-7 linux-headers-2.6.27-7-generic
Use 'apt-get autoremove 'to delete them.
The following additional software packages will be installed:
Dnsmasq-base
Recommended software packages:
Resolvconf
The following [new] software packages will be installed:
Dnsmasq-base
A total of 0 software packages have been upgraded, 2 new software packages have been installed, 0 software packages have to be uninstalled, and 0 software have not been upgraded. Www.britepic.org
Download a kb package.
Decompress the package to consume KB of extra space.
Do you want to continue? [Y/n] Y
2. Configure/etc/dnsmasq. conf
Expand-hosts
Domain = example.com
Dhcp-range = 192.168.0.50, 192.168.0.150, 12 h
Dhcp-option = 3, 192.168.0.1
Dhcp-option = 6, 192.168.0.5
The above configuration options enable the DHCP service and set domain to "example.com ". The IP address range provided by the DHCP service is 192.168.0.50 to 192.168.0.150. the renewal period is 12 hours. The gateway is 192.168.0.1 and the dns server is 192.168.0.5.