[Pdns-users] Fancy-records and urlredirector

A/S ScanNet - Dan Faerch dan at scannet.dk
Thu Jun 12 07:47:51 UTC 2003


> traffic directly, but only URL requests from PDNS.
No.. PDNS does not do anything but dns.. No proxy or tunnneling or the
likes..
What PDNS does with a fancy record is simply returning an A record..
You have eg:
www.test.com - URL - http://whatever.com
in your zone.

A user types www.test.com in his webbrowser..

Powerdns looks into the zone, finds type=URL.. Then it takes the IP if the
URL-redirector (specified in config).. Lets say it has 194.255.66.1.
Now powerdns returns the following to the webbrowser:

www.test.com - A - 194.255.66.1

and the webbrowser goes to 194.255.66.1 port 80 (as with any normal
webbrowser request)..  The webbrowser then communicates with 194.255.66.1 as
it would with any other webserver.. The webbrowser (roughly) sends something
like this to 194.255.66.1:80.:
GET / HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
Host: www.test.com


You have to somehow look into the PDNS-database to find the "content" field
according to the "Host:" header.. In my example it was http://whatever.com.
Now WHAT you do with this info is up to you..
Maybe you could port forward or proxy according to the "Host:" header.. Or
simply redirect as i do.. Eitherways, youd proberbly have to code a little
something..
You proberbly could have a "content" field containing an 10.0.0.x ip address
and somekinda proxy on 194.255.66.1.

But i do not know of any software that can do this without modifying it
first..


-Dan Faerch
A/S ScanNet

ps. the pdns server and the 194.255.66.1 be the same server (hell, even same
ip), but that does still not make it a proxy.. :)



>
> > Im not sure if you can make it work with mod_rewrite.. You have
> > to look into the database everytime someone requests a domainname..
> > Pesonally we use a PHP script to do the trick..<snip>
>
> That would work fine, except I have 10 servers behind the PDNS server, and
> no way to determine which server should recieve the request in the first
> place,
> so it will (and does) die at the PDNS server. I have A records for all the
> domains I host, just no way to point them at their respective servers.
> My setup is like so...
>
> Internet
>    |
> x.x.x.x (Internet IP)
> PDNS_1
> 10.0.0.1 (PDNS Server)
>    |
> Switch
> ||||||
> WWW_1 - 10.0.0.10 (needs to answer for www.domain1.com, www.another1.com,
> etc)
> WWW_2 - 10.0.0.11 (needs to answer for www.domain2.com,
> www.stillanother.com, etc)
> ...
> WWW_10 - 10.0.0.20 (needs to answer for www.domain10.com,
> www.yetanotherdomain.com, etc)
>
> So if an http-request is recieved by PDNS_1 on it's internet interface for
> www.domain2.com, I need it to be able to forward on the request to the
> proper
> machine, WWW_2 in this case. Simple port-forwarding won't work, and the
> private
> IP's of the WWW_* machine's make for very bad A records :) I can only
think
> that
> if the urlredirector will work the way I imagine it, I can either use
Apache
> or
> write a little lightwieght app to do the proper routing behind the PDNS
> server for me.
> If it doesn't, I guess I'm up the proverbial creek, but I can't help
> thinking that
> I can't be the only one who's ever needed to do this. Or perhaps it's
simply
> my
> network setup/topology is all wrong for what I'm trying to accomplish.
> Thanks for the
> script though, I might be able to adapt it to work from the PDNS server,
who
> knows! :)
>
> D.Mills
>
> _______________________________________________
> Pdns-users mailing list
> Pdns-users at mailman.powerdns.com
> http://mailman.powerdns.com/mailman/listinfo/pdns-users
>
>



More information about the Pdns-users mailing list