Skip to content

Instantly share code, notes, and snippets.

@stephenemslie
Last active August 29, 2015 14:06
Show Gist options
  • Save stephenemslie/04b48c59f84aa105a542 to your computer and use it in GitHub Desktop.
Save stephenemslie/04b48c59f84aa105a542 to your computer and use it in GitHub Desktop.
A little dns server to resolve `localdocker` to the ip address of your boot2docker VM.
// This needs to listen on port 53, so run with sudo node boot2docker-dns.js
var exec = require('child_process').exec;
var jack = require('dnsjack').createServer();
jack.route('localdocker', function(domain, callback){
exec('sudo -u $SUDO_USER boot2docker ip', function(err, stdout, stderr){
callback(null, stdout);
});
});
jack.listen();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment