LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-21-2024, 04:53 PM   #1
vinmansbrew
Member
 
Registered: Feb 2016
Posts: 192

Rep: Reputation: Disabled
firewalld rule to block url


Rhel 7.9 using firewalld
I know how to block IPs, what I'd like to do is block a url. For example compute-1.amazonaws.com, so that anything from that address gets blocked.

Is there a way to do this, without camping netstat and blocking every IP I see from the address?

I haven't found anything that seems to reference doing this.

Thanks
 
Old 03-21-2024, 06:48 PM   #2
mw.decavia
Member
 
Registered: Feb 2024
Distribution: Slackware64-15 & Afterstep , oh my
Posts: 80

Rep: Reputation: 9
Yes, there is a way. At least two ways that I can think of.

(1) Use "pi hole", which is not just for Raspberry pi anymore.

(2) Set your machine (or lan) up with a caching dns server, in which you define unwanted hosts/domains like "compute-1.amazonaws.com" to have a particular -reserved- ip-address like (192.0.0.1) and then you have firewalld block (192.0.0.1)

Quote:
Originally Posted by vinmansbrew View Post
Rhel 7.9 using firewalld
I know how to block IPs, what I'd like to do is block a url. For example compute-1.amazonaws.com, so that anything from that address gets blocked.

Is there a way to do this, without camping netstat and blocking every IP I see from the address?

I haven't found anything that seems to reference doing this.

Thanks
 
Old 03-22-2024, 10:00 AM   #3
vinmansbrew
Member
 
Registered: Feb 2016
Posts: 192

Original Poster
Rep: Reputation: Disabled
Two sounds like some extra work. I think I'll check out pi hole first!
 
Old 04-04-2024, 07:33 AM   #4
friendlysalmon8827
Member
 
Registered: Dec 2023
Distribution: Anfroid,Debian
Posts: 99

Rep: Reputation: 5
For one I do believe that RHEL 7 series is coming it's end of life,so I'd recommend the the OP consider looking into RHEL 8.9 or 9.x series of RHEL.
 
  


Reply



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
[SOLVED] I don't understand why this port rule in firewalld mtdew3q Linux - Security 3 05-22-2022 06:26 PM
[SOLVED] I want to add/convert an iptables rule to Firewalld RadicalDreamer Linux - Networking 4 11-15-2020 12:17 AM
Socket server security firewalld rich rule vs logwatch newbie14 Linux - Security 6 10-02-2020 10:53 AM
[SOLVED] firewalld - cannot state a rule with port range Sum1 Linux - Software 1 04-11-2018 03:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 04:51 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