当前位置:网站首页>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 .
边栏推荐
- leetcode 474. Ones and zeroes (medium)
- 基金销售行为规范及信息管理
- Shell multitasking to download video at the same time
- In depth analysis of Apache bookkeeper series: Part 4 - back pressure
- composer
- Detailed explanation of conv2d -- use in arrays and images
- Reason why wechat payment wxpaypubhelper V3 callback XML is empty
- 股票开户要如何办理呢?办理手机开户安全吗
- Meet the streamnational | yangzike: what made me give up Dachang offer
- C# /platform:anycpu32bitpreferred 只能与 /t:exe、/t:winexe 和 /t:appcontainerexe 一起使用
猜你喜欢
![[NLP] [textcnn] text classification](/img/bb/c8fd9f1ed458a88a17b8d5c70d9ce2.png)
[NLP] [textcnn] text classification

Introduction to digital transformation solutions for enterprises going to sea

ESP8266 成为客户端和服务器

Two way data binding in wechat applet

conv2d详解--在数组和图像中的使用

HP 惠普笔记本电脑 禁用触摸板 在插入鼠标后

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

New trends of China's national tide development in 2022

QQmlApplicationEngine failed to load component qrc:/main. qml:-1 No such file or directory

6-1 exploit -ftp exploit
随机推荐
C# /platform:anycpu32bitpreferred 只能与 /t:exe、/t:winexe 和 /t:appcontainerexe 一起使用
唯一性索引与逻辑删除冲突问题解决思路
有孚网络混合云,加速企业数字化转型升级
Is it safe to choose mobile phone for stock trading account opening in Guangzhou?
d编译时计数
Cloud games | cloud computing drives the game industry into a "new era"
云游戏| 云计算推动游戏行业进入“新纪元”
Shell multitasking to download video at the same time
Matlab saves triangulation results as STL files
基金客户和销售机构
[NLP] [textcnn] text classification
智慧路灯| 云计算点亮智慧城市的“星星之火”
Qlineedit of QT notes (74) specifies the input type
lvm-snapshot:基于LVM快照的备份之准备工作
Why did kubernetes win? The changes in the container circle!
Fund clients and sales agencies
E-commerce seckill system
股票开户要如何办理呢?办理手机开户安全吗
[leetcode] [SQL] notes
基金客户服务