Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
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.
|
|
05-25-2004, 11:19 AM
|
#1
|
LQ Newbie
Registered: Aug 2003
Location: Fargo, ND
Posts: 25
Rep:
|
forward all dns requests to one page
Hello All,
I'm setting up bind on a linux box that I want to forward every request that comes to it to a specific webserver I've setup. I've looked all over the place and can't find how you do this, but I know you can... anyone have any insight?
Thanks in advance..
|
|
|
05-25-2004, 11:36 AM
|
#2
|
Senior Member
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188
Rep:
|
every ? i cannot get.
bind listens to port 53 (domain port). when your clients ask it some domians it finds the ip of that domains and send the answer to clients. also it answers other nameserver if they ask about your domain. u can just add a record for your web server in zone files. u cannot forward all http recuests to your web server with bind.
can u explain moreabout your question?
Last edited by maxut; 05-25-2004 at 11:37 AM.
|
|
|
05-25-2004, 11:48 AM
|
#3
|
LQ Newbie
Registered: Aug 2003
Location: Fargo, ND
Posts: 25
Original Poster
Rep:
|
What I'm doing is setting up a wireless authentication system based on mac's and some other stuff, and when some random dude walks in the building we want him to get an ip from the dhcp from a different pool then registered users, which we did with the dhcpd.conf.. Along with that differnent ip we give him the ip of a dns I've setup on the same box. So then every web request the guy does will get redirected to the defualt page on a webserver we setup, also on that same box that says "You aren't a registered user of the wireless, please stop by and register blah blah blah"
The cable company up here in Fargo uses the exact same thing to register their cable modem users. If you hook up for the first time you get a registration page from one of their webserver and once you register your mac with them you get through normal every time..
So the only part I can't figure out is how to get bind to return the ip of the webserver I want for any and all page requests that come to it..
|
|
|
05-25-2004, 12:37 PM
|
#4
|
Senior Member
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188
Rep:
|
u need iptables commands as i understand.
do u have a like that network:
that guy (LAN2)-----linux(firewall,router,nat,etc)----internet
........................................ |
............................web server (for that guy) LAN1
if it is so u can forward http recuests which come from LAN2 network to web server by typing following iptables command:
#iptables -t nat -A PREROUTING -s LAN2/subnet -p tcp --dport 80 -j DNAT --to webserver_ip
#iptables -t nat -A POSTROUTING -d LAN2/subnet -s webserver_ip -p tcp --sport 80 -j SNAT --to linux_LAN2_NIC_ip
|
|
|
05-25-2004, 01:34 PM
|
#5
|
LQ Newbie
Registered: Aug 2003
Location: Fargo, ND
Posts: 25
Original Poster
Rep:
|
keewl..
One guy told me that might work.. I'll giver a shot..
Thanks!
|
|
|
All times are GMT -5. The time now is 03:15 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
|
|