How to build a Next-Gen RequestBin


Follow the last topic, we have just release new verion with some new features. In this new system, we have 3 parts:

  1. Main website run on Heroku
  2. DNS server for DNSBin
  3. Blog

Our source code is open on Please follow some bellow step to install an instance like

Pre-installation Requirements

  1. A domain with full DNS control
  2. A Heroku account
  3. A VPS run linux server
  4. A mongodb server

1. Setup website on Heroku

First, clone this repo using git:

$ git clone

From the project directory, create a Heroku application:

$ heroku create

Set an environment variable to indicate production:

$ heroku config:set

$ heroku config:set MONGODB_URI=mongodb://user:[email protected]:port/db?retryWrites=true

Now just deploy via git:

$ git push heroku master

It will push to Heroku and give you a URL that your own private RequestBin will be running.

Important: The RequestBin Next Gen run like "Multi-Tenant". So, the domain config step bellow is very important: Set main domain as normal:

$ heroku domains:add

The CNAME got after this command like is use for DNS config.

Next, add wildcard subdomain for "Multi-Tenant"

$ heroku domains:add *

The CNAME got after this command like must be memory for next step.

2. Setup DNS Server

This step must be done on the prepared server.

Clone this repo using git:

$ git clone


$ cd dnsbin/

$ mv

Change MONGODB_URI and WORK_PATH as your system. Especially, change the CNAME as the CNAME which you got after config * at last step.

Setup Iptables to forward port 53

Because you cannot open directly port 53, you must open another and forward port via Iptables via bellow rules:

-A PREROUTING -i eth0 -p tcp -m tcp --dport 53 -j REDIRECT --to-ports 8853
-A PREROUTING -i eth0 -p udp -m udp --dport 53 -j REDIRECT --to-ports 8853
-A INPUT -m state --state NEW -m tcp -p tcp --dport 53 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 53 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8853 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 8853 -j ACCEPT

Setup supervisor

Read here for the guide to install supervisor

After that, use the file at dnsbin/supervisor.conf for the dnsbin application.

DNS Config

On this step, you must use the DNS controller to add 2 records bellow:

  • Add a "A" record for the domain "" that points to "the server ip".
  • Add a "NS" record for the domain "" with the value "the server ip".

3. Setup Blog

The blog on is automatically synchronized from our Github repo

You can setup a repo like the requestbin/blog with bellow steps:

Edit the

$ cd blogsync
$ mv

Change MONGODB_URI, BLOG_REPO as yours. The BLOG_REPO's format is requestbin/blog

Run synchronize

$ bash

You can run it periodically by installing via crontab.

Good luck!