LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-27-2018, 03:57 AM   #1
Egorkkk
LQ Newbie
 
Registered: Nov 2011
Posts: 3

Rep: Reputation: Disabled
Centos 7 firewalld - how to block outgoing DNS queries?


Hello!

I want to block all outgoing DNS queries to 53 port, except for DNS queries to one specific IP of DNS server.

I think it should be a rich rule for firewalld but don't know how to write it correctly.

Only firewalld, not iptables, because all other firewall rules works fine.

Thank you.
 
Old 03-27-2018, 04:19 AM   #2
tshikose
Member
 
Registered: Apr 2010
Location: Kinshasa, Democratic Republic of Congo
Distribution: RHEL, Fedora, CentOS
Posts: 525

Rep: Reputation: 95
man 5 firewalld.richlanguage
 
Old 03-27-2018, 04:40 AM   #3
Egorkkk
LQ Newbie
 
Registered: Nov 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by tshikose View Post
man 5 firewalld.richlanguage
Man is very good thing, of course. And i read it, but...

But little example can be much more useful for me.
Thank you )
 
Old 03-27-2018, 05:06 AM   #4
tshikose
Member
 
Registered: Apr 2010
Location: Kinshasa, Democratic Republic of Congo
Distribution: RHEL, Fedora, CentOS
Posts: 525

Rep: Reputation: 95
Try the command below.
I did not test.
So please be sure of what you do.

Code:
firewall-cmd --add-rich-rule='rule family="ipv4" destination not address="8.8.8.8" port port="53" protocol="udp" reject'
 
  


Reply

Tags
centos7, dns, firewalld



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Firewalld command to block all outgoing connection to specific system user roopakl Linux - Newbie 5 04-18-2017 05:04 AM
[SOLVED] Firewalld drop/block large ip address range Sum1 CentOS 2 01-27-2017 02:38 PM
[SOLVED] CentOS 7 - Problems with firewalld/iptables on CentOS 7 Router -Can't connect to MariaDB between private networks (Virtual Box) arkfantasy CentOS 4 01-09-2017 01:56 PM
[SOLVED] firewalld block ip ranging but allow single ip packetsmacker Linux - Security 7 01-28-2016 02:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration