thejake
Power Member
- Nov 13, 2009
- 683
- 832
In its grand tradition of getting everybody to use something then yanking it out from under them, Google shuttered Adsense for Domains. I used to use other parking companies but not only were they a general pain in the ass, I always felt like they were skimming too much and were ban-happy.
So I figured I'd put together my own solution to keep that $2 per domain per month rolling in with minimal effort, preferably 0 effort other than register the domain and set a nameserver.
To make this dream come true, all you need is $5-10/month worth of VPS, tops, with at least two public IPs to let you configure DNS proper. There's actually $30/year VPS packages that are overkill for parking purposes.
The DNS server that makes building your own parking lot easiest is called powerdns, it lets you write piped backends with a really simple API. This lets you emulate the parking companies' DNS setup with a simple chunk of python like this:
Configuring that script as your backend lets you answer any query for any real tld with the IPs coded into the script, and lets you either register ns's for those IPs or use another domain registered to those IPs. In my version of this I give some consideration to MX records and use a specific algorithm for SOA serial numbers, just something to keep in mind.
Of course when you're serving up the same IP for all queries you need a webserver serving up some plausible monetized content-type stuff. A good option is a geoip-specific offer wall from a CPA network. Another good option is an offer feed. If you were, for example, to use every forum's favorite (lulz) CPA network (now known as MonetizeDigital) it might look like this:
Something like that as your wildcard or default host ends up looking like http://4vp.me and http://usbflashdrivez.info and don't worry those don't use real publisher ids or ad units, they're just demos.
Of course you'd probably want to add some sort of contact or make-an-offer type thing, and maybe some contextual features to automatically add some content so G doesn't filter the domain as parked. Lots of potential.
If you read this and have no idea WTF a good linux/python guy should be able to pop something together for you based on this within an hour. Not me though, thanks anyway. Good luck bros.
So I figured I'd put together my own solution to keep that $2 per domain per month rolling in with minimal effort, preferably 0 effort other than register the domain and set a nameserver.
To make this dream come true, all you need is $5-10/month worth of VPS, tops, with at least two public IPs to let you configure DNS proper. There's actually $30/year VPS packages that are overkill for parking purposes.
The DNS server that makes building your own parking lot easiest is called powerdns, it lets you write piped backends with a really simple API. This lets you emulate the parking companies' DNS setup with a simple chunk of python like this:
Code:
#!/usr/bin/env python
import sys
mainip = '10.0.0.1' # ns1.domain ip
secip = '10.0.0.2' #ns2.domain ip
ttl = 300 #to suit
infile = sys.stdin
outfile = sys.stdout
def putf(message):
outfile.write(message + '\n')
outfile.flush()
def dnslookup(query):
(_type, qname, qclass, qtype, _id, ip) = query
parts = qname.split('.')
mainpart = '%s.%s' % (parts[-2], parts[-1])
results = []
results.append('LOG\t%s'%mainpart)
if (mainpart==qname):
if (qtype == 'SOA' or qtype == 'ANY') :
results.append('DATA\t%s\t%s\tSOA\t%d\t-1\t%s\t%s\t%d\t%d\t%d\t%d\t%d' %
(qname, qclass, ttl, 'ns1.' + mainpart,
'postmaster.' + mainpart,
2011010101, 7200, 1800, 604800, 28800))
if (qtype == 'NS' or qtype == 'ANY') :
results.append('DATA\t%s\t%s\tNS\t%d\t-1\t%s' %
(qname, qclass, ttl, 'ns1.' + mainpart))
results.append('DATA\t%s\t%s\tNS\t%d\t-1\t%s' %
(qname, qclass, ttl, 'ns2.' + mainpart))
if (qtype == 'A' or qtype == 'ANY') :
results.append('DATA\t%s\t%s\tA\t%d\t-1\t%s' %
(qname, qclass, ttl, mainip))
else:
if (qtype == 'A' or qtype == 'ANY') :
results.append('LOG\tANY OTHER')
if (qname.lower() == 'ns2.'+mainpart):
results.append('LOG\tNS2')
results.append('DATA\t%s\t%s\tA\t%d\t-1\t%s' %
(qname, qclass, ttl, secip))
else:
results.append('DATA\t%s\t%s\tA\t%d\t-1\t%s' %
(qname, qclass, ttl, mainip))
return results
if __name__ == '__main__':
first_time = True
while True:
rawline = infile.readline()
if rawline == '':
break # WUT
line = rawline.rstrip()
if first_time:
if line == 'HELO\t1':
putf('OK\tBackend Ready')
else:
putf('FAIL')
rawline = infile.readline()
sys.exit(1)
first_time = False
else:
query = line.split('\t')
if len(query) != 6:
putf('LOG\tBad line')
putf('FAIL')
else:
lookup = dnslookup(query)
if (len(lookup)>0): putf('\n'.join(lookup))
else: putf('\n')
putf('END')
Configuring that script as your backend lets you answer any query for any real tld with the IPs coded into the script, and lets you either register ns's for those IPs or use another domain registered to those IPs. In my version of this I give some consideration to MX records and use a specific algorithm for SOA serial numbers, just something to keep in mind.
Of course when you're serving up the same IP for all queries you need a webserver serving up some plausible monetized content-type stuff. A good option is a geoip-specific offer wall from a CPA network. Another good option is an offer feed. If you were, for example, to use every forum's favorite (lulz) CPA network (now known as MonetizeDigital) it might look like this:
Code:
<?php
if ($id = $_SERVER['QUERY_STRING']) {
if ($link = $_COOKIE[$id]) {
header('Location: '.$link);
}
snurb(); //intentional
}
$user_ip = $_SERVER["REMOTE_ADDR"];
$servername = strtolower($_SERVER['SERVER_NAME']);
$parts = explode('.',$servername);
if(count($parts)>2) {
$rd = '.'.end($parts);
$rd = prev($parts).$rd.'/';
header('Location: http://'.$rd);
return;
}
ob_start();
?>
<!DOCTYPE html>
<html>
<head>
<title><?php echo $servername; ?></title>
<style>
#main {
font-family: arial, san-serif;
width: 1000px;
margin: 0 auto;
background: #fff url('http://www.gstatic.com/domainads/t/ocean/v1/images/background.jpg') no-repeat top center;
padding: 10px 20px 10px 40px;
}
a {
font-size: 14pt;
}
#list {
width: 64%;
margin-top: 1px;
border-top: 1px solid #888;
}
.offer {
padding-top: 15px;
}
h1 {
color: #335ca5;
}
h3 {
color: #888;
font-size: 14pt;
}
</style>
</head>
<body>
<div id="main">
<h1><?php echo $servername; ?></h1>
<h3>Sponsored Listings</h3>
<div id="list">
<?php
$call_url = "http://www.monetizedigital.com/dashboard/reports/campaign_rss.php?id=100100&show=10&geoip=" . $user_ip;
if($xml = simplexml_load_file($call_url, "SimpleXMLElement", LIBXML_NOCDATA))
{
foreach($xml->channel->item as $offers)
{
$campaign = $offers->children("http://www.monitizedigital.com/feeds/campinfo.php");
$offer_link = $offers->link;
$offer_raw_name = $offers->title;
$offer_name = trim(strip_tags($offer_raw_name));
$offer_id = $campaign->campid;
$offer_country = $campaign->country;
$offer_type = $campaign->type;
setcookie($offer_id,$offer_link);
?><div class="offer">
<a href="/?<?php echo $offer_id; ?>"><?php echo $offer_name; ?></a><br />
<span style="font-weight: normal;"><?php echo urldecode($offers->description); ?></span>
</div>
<?php
}
}
?>
</div>
<hr />
</div>
</body>
</html>
Something like that as your wildcard or default host ends up looking like http://4vp.me and http://usbflashdrivez.info and don't worry those don't use real publisher ids or ad units, they're just demos.
Of course you'd probably want to add some sort of contact or make-an-offer type thing, and maybe some contextual features to automatically add some content so G doesn't filter the domain as parked. Lots of potential.
If you read this and have no idea WTF a good linux/python guy should be able to pop something together for you based on this within an hour. Not me though, thanks anyway. Good luck bros.