Mike Schilli's Friendly Neighborhood Perl Shop

Home
USArundbrief.com
Resume
CPAN Modules
Articles in English
Articles in German
Mike's Script Archive
English-Japanese Translation Trainer
Adventures with O'Reilly's Safari
10 Easy Steps to Become a California Driver
Unofficial perlmonks.com IRC Channel
My Collection of Outage Pages
Prisma (Computer Club Deutschland)
Mike's Monologues
Mike's Script Archive: dns

dns - Resolve DNS entries via HTTP


NAME

    dns - Resolve DNS entries via HTTP


DOWNLOAD

dns


SYNOPSIS

    http://ip-address-of-helper/cgi-bin/dns/hostname-to-be-resolved


DESCRIPTION

dns is a CGI script that simple looks up a given host's IP address. Why would you need that?

If one box on your network doesn't have access to a DNS server, but another one does, and you know its IP address, and it runs a web server, you can get DNS entries resolved this way:

    http://ip-address-of-helper/cgi-bin/dns/hostname-to-be-resolved

This will call the dns CGI script on the helper host, which will run a gethostbyname on hostname-to-be-resolved and send back the result via HTTP.


EXAMPLES

    http://192.168.0.32/cgi-bin/dns/www.aol.com

will send back something like

    HTTP/1.1 200 OK
    Date: Sun, 14 Mar 2004 03:18:22 GMT
    Server: Apache/1.3.23 (Unix) mod_perl/1.27
    Connection: close
    Content-Type: text/html; charset=ISO-8859-1
    205.188.145.214


LEGALESE

Copyright 2004 by Mike Schilli, all rights reserved. This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.


AUTHOR

2004, Mike Schilli <m@perlmeister.com>


Latest update: 20-Oct-2013