LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 08-10-2007, 04:07 AM   #1
sunlinux
Member
 
Registered: Feb 2006
Distribution: RHCL 5
Posts: 239

Rep: Reputation: 30
restrict dns lookup for for a domain


Can we restrict dns lookup for a particular domain such as chatenabled.mail.google.com(used for google chat) with iptables or somehow ?

I want to block chat using gmail.com ( gmail suggested the method to block using above method)
 
Old 08-10-2007, 06:04 AM   #2
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
I think if you install your own DNS server (bind) you can return a fake address whenever gmail.com is requested. Since users w/o administrative right cannot change their network settings they cannot change the DNS server.

Blocking the IP of gmail is next to impossible as these large sites often use a range of IP addresses.

jlinkels
 
Old 08-10-2007, 06:45 AM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Quote:
Originally Posted by jlinkels
Blocking the IP of gmail is next to impossible as these large sites often use a range of IP addresses.
well that's the point of the question isn't it? stop the dns query that gets one of the range in the first place. not foolproof of course, but what you're asking fairly simple and totally possible. if you use the string module in iptables and also match on port 53, then you can easily drop any packet being passed through the router on port 53 which contains the string relevant to the domain you want...

Code:
iptables -I FORWARD -p udp --dport 53 -m string --string "chatenabled.mail.google.com" -j DROP
i guess this would work, not tested though... again not the best solution, but a start...
 
  


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
Forward DNS lookup to different DNS Servers ghight Linux - Networking 2 09-28-2006 05:54 AM
Traceroute, Ping, Domain Name Server (DNS) Lookup, WHOIS, and DNS Records Lookup netoknet General 1 05-09-2005 03:43 AM
Qn: How to restrict in/out emails within a domain name/internal organisation only? rebel Red Hat 11 08-24-2004 07:25 AM
Qn: How to restrict in/out emails within a domain name/internal organisation only? rebel Linux - Security 1 08-18-2004 11:03 PM
ERROR: Failed to lookup IP address for (domain name) aluminum Linux - Newbie 7 11-11-2003 08:27 PM

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

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