当前位置:网站首页>Deploy DNS server using dnsmasq
Deploy DNS server using dnsmasq
2022-06-24 06:34:00 【zero000】
brief introduction
dnsmasq It is often used for simple deployment DNS The server and DHCP The server , Here's how to use dnsmasq Deploy a simple DNS The server
install dnsamsq
Reference resources here
To configure dnsmasq
sudo vi /etc/dnsmasq.conf
domain-needed bogus-priv no-resolv server=8.8.8.8 # forward Server for server=8.8.4.4 # forward Server for local=/mydomain.org/ # mydomain.org Use local resolution , Don't make forward listen-address=::1,127.0.0.1,192.168.1.10 # Bind the specified network interface expand-hosts # Use the following domain Automatic completion of domain name resolution , for example /etc/hosts Configured with "test 127.0.0.1" , At this time, the client queries "dig test.mydomain.org" The corresponding resolution can be obtained # below DHCP relevant ,domain Above field DNS Configuration will use domain=mydomain.org dhcp-range=192.168.1.100,192.168.1.200,24h dhcp-option=option:router,192.168.1.1 dhcp-authoritative dhcp-leasefile=/var/lib/dnsmasq/dnsmasq.leases
Add records
Use it directly /etc/hosts Records of are used as dns analysis
sudo vi /etc/hosts
Add the following record
127.0.0.1 localhost localhost.localdomain ::1 localhost localhost.localdomain 192.168.1.1 router 192.168.1.10 dnsmasq 192.168.1.20 server1 192.168.1.30 server2
start-up dnsamsq
sudo systemctl restart dnsmasq
test
Forward parsing test
$ nslookup server1 Server: 127.0.0.1 Address: 127.0.0.1#53 Name: server1.mydomain.org Address: 192.168.1.20
Reverse test
$ nslookup 192.168.1.20 20.1.168.192.in-addr.arpa name = server1.mydomain.org.
Test external domain name resolution
$ nslookup fedoramagazine.org Server: 127.0.0.1 Address: 127.0.0.1#53 Non-authoritative answer: Name: fedoramagazine.org Address: 35.196.109.67
Realization DNS Round Robin
Query some historical data ,dnsmasq It doesn't support DNS Round Robin Of , But subsequent versions seem to have supported this feature
The key is addn-hosts This configuration
Take the configuration just now as an example , Add the following configuration
domain-needed bogus-priv no-resolv server=8.8.8.8 # forward Server for server=8.8.4.4 # forward Server for local=/mydomain.org/ # mydomain.org Use local resolution , Don't make forward listen-address=::1,127.0.0.1,192.168.1.10 # Bind the specified network interface expand-hosts # Use the following domain Automatic completion of domain name resolution , for example /etc/hosts Configured with "test 127.0.0.1" , At this time, the client queries "dig test.mydomain.org" The corresponding resolution can be obtained .... addn-hosts=/etc/dnsmasq.addn-hosts/
Create the corresponding file , Store domain name A Parsing records
$ mkdir -p /etc/dnsmasq.addn-hosts/ $ vi /etc/dnsmasq.addn-hosts/test.domain # Be careful , You need to add FQDN(Fully Qualified Domain Name) domain name 192.168.1.30 server2.test.com 192.168.1.31 server2.test.com 192.168.1.32 server2.test.com
The last restart dnsamsq
sudo systemctl restart dnsmasq
Now , Test record
$ dig server2.test.com +short 192.168.1.30 192.168.1.31 192.168.1.32
Reference resources :
边栏推荐
- Tencent cloud won the "best customer value award for security hosting services in China" from Sullivan toubao Research Institute
- 创客教育给教师发展带来的挑战
- Small programs import Excel data in batches, and cloud development database exports CVS garbled code solution
- 基于三维GIS系统的智慧水库管理应用
- Continuously evolving cloud native application delivery
- Correct way to update Fedora image Yum source to Tencent cloud Yum source
- "Adobe international certification" design white must understand the color theory, absolutely full of dry goods
- Royal treasure: an analysis of SQL algebra optimization
- The 2021 Tencent digital ecology conference landed in Wuhan, waiting for you to come to the special session of wechat with low code
- Excel data extraction technique: a universal formula for extracting numbers from mixed text
猜你喜欢

Enter the software test pit!!! Software testing tools commonly used by software testers software recommendations

【二叉数学习】—— 树的介绍

A cigarette of time to talk with you about how novices transform from functional testing to advanced automated testing

ServiceStack. Source code analysis of redis (connection and connection pool)

Manual for automatic testing and learning of anti stepping pits, one for each tester
Fault analysis | using --force to batch import data leads to partial data loss

基于三维GIS系统的智慧水库管理应用

创客教育给教师发展带来的挑战

The product layout is strengthened, the transformation of digital intelligence is accelerated, and FAW Toyota has hit 2022million annual sales

解读AI机器人产业发展的顶层设计
随机推荐
Double non students, self-taught programming, counter attack Baidu one year after graduation!
The errorcontrol registry of the third-party service is 3, which may cause the system to cycle restart. For example, ldpkit introduced by WPS
Technology is a double-edged sword, which needs to be well kept
Water conservancy RTU telemetry terminal
TRTC applet custom message
Forbid viewing source code in web page (protect source code)
What is Druid
Easycvr is cascaded to easygbs through gb28181 protocol. Notes on video channel failure
Analysis of official template of wechat personnel recruitment management system (III)
Free and easy-to-use screen recording and video cutting tool sharing
The difference between ArrayList and LinkedList and the principle of using scene locality
Excel data extraction technique: a universal formula for extracting numbers from mixed text
Skips allowed on SAP QM material master inspection type
WordPress pill applet build applet from zero to one [pagoda panel environment installation]
How to open a hidden file
Kubernets traifik proxy WS WSS application
Easyscreen live streaming component pushes RTSP streams to easydss for operation process sharing
基于三维GIS系统的智慧水库管理应用
Replacing human eyes -- visual inspection technology
Feign request return value inverse sequence localdatetime exception record