Last active
August 29, 2015 14:06
-
-
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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