/landrush

A Vagrant plugin that provides a simple DNS server for Vagrant guests

Primary LanguageRubyMIT LicenseMIT

Landrush: DNS for Vagrant

Build Status Build Status

Landrush is a simple cross-platform DNS for Vagrant VMs that is visible on both, the guest and the host.

It spins up a small DNS server and redirects DNS traffic from your VMs to use it, automatically registering/unregistering IP addresses of guests as they come up and go down.



Installation

Install under Vagrant (1.1 or later):

$ vagrant plugin install landrush

Getting started

  1. Enable the plugin in your Vagrantfile:

    config.landrush.enabled = true
  2. Bring up a machine.

    $ vagrant up
  3. You are able to get your VM’s hostname resolved on your host:

    $ dig -p 10053 @localhost myhost.vagrant.test
  4. If you shut down your guest, the entries associated with it will be removed.

Landrush retrieves your VM’s hostname from either the vagrant config or it uses the system’s actual hostname by running the hostname command. A default hostname of "guest-vm" is assumed if the hostname is otherwise not available.

A Landrush example configuration could look like this:

Vagrant.configure("2") do |config|
  config.vm.box = "hashicorp/precise64"

  config.landrush.enabled = true

  config.vm.hostname = "myhost.vagrant.test"

  config.landrush.host 'static1.example.com', '1.2.3.4'
  config.landrush.host 'static2.example.com', '2.3.4.5'
end

See the Usage guide for further information.

Available CLI commands

Check out vagrant landrush help for the available commands.

vagrant landrush <command>

commands:
  {start|stop|restart|status}
    control the landrush server daemon
  list, ls
    list all DNS entries known to landrush
  dependentvms, vms
    list vms currently dependent on the landrush server
  set { <host> <ip> | <alias> <host> }
    adds the given host-to-ip or alias-to-hostname mapping.
    Existing host ip addresses will be overwritten
  rm, del { <host> | <alias> | --all }
    delete the given hostname or alias from the server.
     --all removes all entries
  help
    you're lookin at it!

Troubleshooting

See the Troubleshooting guide to resolve issues you face while using Landrush.

Help Out!

This project needs your feedback and help! Please do not hesitate to open issues or submit pull requests. We welcome your input. If you wish to contribute to the development of Landrush, refer to the Contributing guide for details on how you can contribute. The Development guide will help you setup your development environment.