[plug] Domain redirection solution?

Shaun Budding shaun at budding.com.au
Wed Oct 24 19:34:27 WST 2012


Since you haven't had any bites, one solution I've been playing with for a
domain forwarding service is to set up a wildcard zone which will pass
through anything delegated to the specified nameservers to a simple PHP
script which will look up the domain from a MySQL database and forward to
the necessary domain/URL, this allows for collection of hit statistics etc.
and end up at the required destination.

I realise there are security issues with a wildcard service, and to be
honest I haven't put much thought into it so far, but I'm just putting it
out there for some information if you're looking to build your own system,
but you can easily avoid the wildcard and create entries manually if need
be. This would work nicely as a dedicated service on a cheap ~US$15/y VPS.

# apt-get install bind9

# cat > /etc/bind/named.conf.local << EOF
zone "." {
     type master;
     file "/etc/bind/root.zone";
};
EOF

# cat > /etc/bind/root.zone << EOF
@ IN SOA . domain.com. (
        2011122501     ; serial YYYYMMDDnn
        86400          ; refresh (  24 hours)
        7200           ; retry   (   2 hours)
        3600000        ; expire  (1000 hours)
        172800 )       ; minimum (   2  days)

     IN NS ns1.domain.com.
     IN NS ns2.domain.com.

*.   IN A 12.34.56.78
EOF

The index.php is a simple script which will query the database with the
$_SERVER['HTTP_HOST'] variable, record any necessary statistical
information and header('Location: blah') to the final destination. All you
need to do then is create a simple UI where you can check statistics and
add/edit/delete domain names and destinations.

I guess the other question is if you want to forward email too, something
which I'm still looking into either with Postfix or Exim and virtual
aliases with MySQL, so if anyone can lend a hand on that side of things
that would be grand too.


Shaun

On Wed, Oct 24, 2012 at 2:16 PM, Onno Benschop <onno at itmaze.com.au> wrote:

> Anyone?
>
> ()/)/)() ..ASCII for Onno..
> On 23 Oct 2012 07:35, "Onno Benschop" <onno at itmaze.com.au> wrote:
>
>> I received an email from ZoneEdit that reseller services will be
>> discontinued next month. This impacts the 49 domains I have hosted there. I
>> have started the process of looking for another service provider and am
>> seriously considering Route 53 (Amazon) for a number of reasons.
>>
>> One catch.
>>
>> Route 53 does not support the apex domain redirection (or any other for
>> that matter) that ZoneEdit does. Specifically, making a web request from
>> http://example.com/ turn into http://www.example.com/, or
>> http://brandname.com/ into http://brandname.company.com/ which I use a
>> lot.
>>
>> I'd like to create an appliance where I can configure redirects and point
>> web queries on their merry way.
>>
>> Here's my question:
>>
>> I can build a full Ubuntu server (in the cloud) that does this, but are
>> there more minimalist - read, less updates, less CPU cycles, less
>> maintenance, less software, etc. that I can deploy? Ideally someone can
>> point me at an existing appliance that will do this, or perhaps you have
>> some thoughts on how I might best implement this.
>>
>> Note that I don't really want to engage a 3rd party service, I'm already
>> dealing with many registrars, Google Apps accounts, etc. Less is more for
>> me in this case.
>>
>>
>> Thoughts and comments?
>> --
>> Onno Benschop
>>
>> ()/)/)()        ..ASCII for Onno..
>> |>>?            ..EBCDIC for Onno..
>> --- -. -. ---   ..Morse for Onno..
>>
>> ITmaze   -   ABN: 56 178 057 063   -  ph: 04 1219 8888   -
>> onno at itmaze.com.au
>>
>
> _______________________________________________
> PLUG discussion list: plug at plug.org.au
> http://lists.plug.org.au/mailman/listinfo/plug
> Committee e-mail: committee at plug.org.au
> PLUG Membership: http://www.plug.org.au/membership
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plug.org.au/pipermail/plug/attachments/20121024/1d297c5a/attachment.html>


More information about the plug mailing list