Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
04-03-2004, 08:51 PM
|
#1
|
LQ Newbie
Registered: Feb 2004
Posts: 27
Rep:
|
Bloack Site in IPTABLES?
How can I block access to a site and all sub-domains from that site in IPTABLES?
I want to block *.site.com
So that the following are all blocked:
abc.site.com
123.site.com
xyz.site.com
Thanks.
|
|
|
04-03-2004, 09:13 PM
|
#2
|
LQ Newbie
Registered: Dec 2003
Location: Toronto,Ontario,Canada
Posts: 18
Rep:
|
Hello,
do a ping on the site.com, obtain the ip address after you have obtain the ip address, login to the linux using at the shell promt type
iptables -A -L INPUT -s site.comIP -j DROP
ping the domain and subdomains, mostly domain and subdomains are hosted on ip address, if you see different ip address you need to block each one of them.
Hope that helps
|
|
|
04-03-2004, 09:20 PM
|
#3
|
LQ Newbie
Registered: Feb 2004
Posts: 27
Original Poster
Rep:
|
> "if you see different ip address you need to block each one of them."
Each subdomain has a different IP address.
So there is no way to use a wildcard?
|
|
|
04-04-2004, 03:55 AM
|
#4
|
Senior Member
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028
Rep:
|
You can use DNS names in the -s option, but it is not recommended to use DNS names.
This slows down the filtering and can be by passed by changing/spoofing DNS.
If the IP addresses found during the ping are within the same IP network then you can specify a address scope, like 192.168.0.0/24
|
|
|
04-06-2004, 12:44 AM
|
#5
|
Member
Registered: Sep 2003
Location: Adelaide, Australia
Distribution: Fedora/RH
Posts: 231
Rep:
|
maybe consider setting up SQUID CACHE that will allow dns blocks. much easier that keeping an eye on constantly changing (and growing) ip addresses for service you want to block.
The other option u have is if you have an Internal DNS set up some "dummy hosts" so for example i was having problems blocking icq in my office because they are getting too smart. So on my DNS server i setup a host login.icq.com which means nobody can login
|
|
|
04-26-2007, 01:26 AM
|
#6
|
Member
Registered: Apr 2001
Location: Brisbane, Australia
Distribution: Ubuntu
Posts: 146
Rep:
|
I too want to block a wildcard domain because the IM system doesn't go through Squid and unlike ICQ the login process has fall back server names if one gets blocked and I can't track them all down.
|
|
|
All times are GMT -5. The time now is 05:33 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|