LinuxQuestions.org
Visit Jeremy's Blog.
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 04-03-2004, 08:51 PM   #1
LQtoto
LQ Newbie
 
Registered: Feb 2004
Posts: 27

Rep: Reputation: 15
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.
 
Old 04-03-2004, 09:13 PM   #2
xerophyte
LQ Newbie
 
Registered: Dec 2003
Location: Toronto,Ontario,Canada
Posts: 18

Rep: Reputation: 1
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
 
Old 04-03-2004, 09:20 PM   #3
LQtoto
LQ Newbie
 
Registered: Feb 2004
Posts: 27

Original Poster
Rep: Reputation: 15
> "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?
 
Old 04-04-2004, 03:55 AM   #4
ugge
Senior Member
 
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028

Rep: Reputation: 45
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
 
Old 04-06-2004, 12:44 AM   #5
chrisfirestar
Member
 
Registered: Sep 2003
Location: Adelaide, Australia
Distribution: Fedora/RH
Posts: 231

Rep: Reputation: 30
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
 
Old 04-26-2007, 01:26 AM   #6
hazza96
Member
 
Registered: Apr 2001
Location: Brisbane, Australia
Distribution: Ubuntu
Posts: 146

Rep: Reputation: 15
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
(IPTABLES) redirect web site to a file? dmane15 Linux - Newbie 9 08-11-2008 05:53 AM
Do you know sourceforge site? How to upload to this site? TruongAn General 2 07-02-2005 05:26 AM
IPtables Log Analyzer from http://www.gege.org/iptables/ brainlego Linux - Software 0 08-11-2003 06:08 AM
vsftp site to site mr.bienzle Linux - Software 0 01-13-2003 10:18 AM
My iptables script is /etc/sysconfig/iptables. How do i make this baby execute on boo ForumKid Linux - General 3 01-22-2002 07:36 AM

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

All times are GMT -5. The time now is 05:33 AM.

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