[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
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 18.104.22.168.
Now powerdns returns the following to the webbrowser:
www.test.com - A - 22.214.171.124
and the webbrowser goes to 126.96.36.199 port 80 (as with any normal
webbrowser request).. The webbrowser then communicates with 188.8.131.52 as
it would with any other webserver.. The webbrowser (roughly) sends something
like this to 184.108.40.206:80.:
GET / HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)
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
You proberbly could have a "content" field containing an 10.0.0.x ip address
and somekinda proxy on 220.127.116.11.
But i do not know of any software that can do this without modifying it
ps. the pdns server and the 18.104.22.168 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
> 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...
> x.x.x.x (Internet IP)
> 10.0.0.1 (PDNS Server)
> WWW_1 - 10.0.0.10 (needs to answer for www.domain1.com, www.another1.com,
> 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
> machine, WWW_2 in this case. Simple port-forwarding won't work, and the
> IP's of the WWW_* machine's make for very bad A records :) I can only
> if the urlredirector will work the way I imagine it, I can either use
> 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
> 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,
> knows! :)
> Pdns-users mailing list
> Pdns-users at mailman.powerdns.com
More information about the Pdns-users