当前位置:网站首页>How to close an open DNS resolver
How to close an open DNS resolver
2022-06-30 23:21:00 【Brother Xing plays with the clouds】
We created it in the previous tutorial DNS The server It's an open DNS Parser . An open parser does not filter any source requests , And will accept from all IP Query for .
-------------------------------------- Split line --------------------------------------
Recommended reading :
Use BIND To configure DNS The server --- Elementary chapter http://www.linuxidc.com/Linux/2013-05/84920.htm
BIND+DLZ+MySQL intelligence DNS Forward parsing and reverse parsing implementation methods of http://www.linuxidc.com/Linux/2013-04/82527.htm
Domain name service BIND Build and apply configuration http://www.linuxidc.com/Linux/2013-04/82111.htm
Ubuntu BIND9 Pan domain name resolution configuration http://www.linuxidc.com/Linux/2013-03/81928.htm
CentOS 5.2 Lower installation BIND9.6 http://www.linuxidc.com/Linux/2013-02/79889.htm
-------------------------------------- Split line --------------------------------------
Unfortunately , Open parsers can easily become an attack target . such as , An attacker can open to DNS The server Launch a denial of service attack (DoS) Or worse Distributed Denial of service attacks (DDoS). These can also be related to IP Deceptive combination , Point the response packet to the victim's cheated IP Address . On other occasions it is called DNS Enlarge the attack , Open DNS The server It's easy to be the target of attack .
according to openresolverproject.org, Unless it is necessary , It is unwise to run an open parser . Most companies want their DNS The server Open only to their customers . This tutorial will just focus on how to configure a DNS The server makes it stop open parsing and respond only to valid clients .
Adjust the firewall
because DNS Running on the UDP Of 53 On port , System management may try to allow only from 53 Port client IP Address , And block the remaining Internet ports . Although it can work , But there will be some problems . Since the root server is connected to DNS Server communication also uses 53 port , We have to make sure that UDP 53 Ports are allowed .
An example of a firewall is shown below . For production servers , Make sure that your rules match your requirements and comply with the company's safety system .
- # vim firewall-script
- ## existing rules are flushed to start with a new set of rules ##
- iptables -F
- iptables -A INPUT -s A.A.A.A/X -p udp --dport 53-j ACCEPT
- iptables -A INPUT -s B.B.B.B/Y -p udp --dport 53-j ACCEPT
- iptables -A INPUT -s C.C.C.C/Z -p udp --dport 53-j ACCEPT
- iptables -A INPUT -p udp --dport 53-j DROP
- ## making the rules persistent ##
- service iptables save
Make the script executable and run it .
- # chmod +x firewall-script
- # ./firewall-script
Prevent recursive queries
DNS Queries can be mainly divided into recursive queries and iterative queries . For recursive queries , The server will respond to the client's reply or error message . If the reply is not in the cache of the server , The server will communicate with the root server and obtain an authorized domain name server . The server will keep querying until the result is obtained , Or request timeout . For iterative queries , On the other hand , The server will point the client to another server that may be able to handle , Then it will reduce the processing of the server itself .
We can control how to run recursive queries IP Address . Our modification is located in /etc/named.conf And add / Modify the following parameters .
- # vim /etc/named.conf
- ## we define ACLs to specify the source address/es ##
- acl customer-a{ A.A.A.A/X;};
- acl customer-b { B.B.B.B/Y; C.C.C.C/Z;};
- ## we call the ACLs under options directive ##
- options {
- directory "/var/named";
- allow-recursion { customer-a; customer-b;};
- };
Adjust the firewall for the open parser
If you have to run an open parser , I suggest you adjust your server properly , So it won't be used .smurfmonitor The repository provides a powerful set of iptables The rules , For example, stop from DNS Amplify the domain name resolution request of the attack . The warehouse will be updated regularly , Strongly recommended DNS Server administrators use it .
in general , For openness DNS Parser The attack of is very common , Especially for those without proper safety protection DNS For servers . This tutorial delays how to disable an open DNS The server . We also saw how to use iptables In an open DNS Add a layer of security protection to the server .
I hope it works for you .
边栏推荐
- Arthas debugging problem determination Toolkit
- composer
- 智慧路灯| 云计算点亮智慧城市的“星星之火”
- Fastjson V2 simple user manual
- Understand target detection in one article: r-cnn, fast r-cnn, fast r-cnn, Yolo, SSD "suggestions collection"
- Netease cloud sign in lottery? That year I could sign in for 365 days. No? Look.
- Solve arm_ release_ ver of this libmali is ‘g2p0-01eac0‘,rk_ so_ Ver is' 4 ', libgl1 mesa dev will not be installed, and there are unsatisfied dependencies
- Two dots on the top of the latex letter
- CNN经典网络模型详解-LeNet-5(pytorch实现)
- shell 同时执行多任务下载视频
猜你喜欢

206页上海BIM技术应用与发展报告2021

Fastjson V2 simple user manual

shell 同时执行多任务下载视频

什么是SRM系统,如何规范公司内部采购流程

HP 惠普笔记本电脑 禁用触摸板 在插入鼠标后
![[fundamentals of wireless communication-13]: illustrated mobile communication technology and application development-1-overview](/img/1d/62e55f1b5445d7349ec383879f4275.png)
[fundamentals of wireless communication-13]: illustrated mobile communication technology and application development-1-overview

Introduction to digital transformation solutions for enterprises going to sea

206 page Shanghai BIM Technology Application and development report 2021

In depth analysis of Apache bookkeeper series: Part 4 - back pressure

Ideal interface automation project
随机推荐
[golang] golang实现截取字符串函数SubStr
Solution to the conflict between unique index and logical deletion
在线客服系统代码_h5客服_对接公众号_支持APP_支持多语言
Reason why wechat payment wxpaypubhelper V3 callback XML is empty
Redis - 01 缓存:如何利用读缓存提高系统性能?
Esp8266 becomes client and server
MaxPool2d详解--在数组和图像中的应用
Qt笔记(七十四)之QLineEdit指定输入类型
Dell r720 server installation network card Broadcom 5720 driver
Smart streetlights | cloud computing lights up the "spark" of smart cities
Fastjson V2 simple user manual
lvm-snapshot:基于LVM快照的备份
基金管理人公司治理和风险管理
The superficial understanding of the industrial Internet finally brought the development of the industrial Internet into the strange circle of the consumer Internet
How to ensure the security of our core drawings by drawing encryption
8253A寄存器浅析
如何使用 DataAnt 监控 Apache APISIX
Detailed explanation of conv2d -- use in arrays and images
股票开户要如何办理呢?办理手机开户安全吗
MIT doctoral dissertation optimization theory and machine learning practice