title: How to access Consul's DNS interface from a hostmachine?
body: <p>I've been trying to create an environment for "microservices". Two of the key components are <strong>Docker</strong> and <strong>Consul</strong>, both run on a virtual machine (I've used <strong>Vagrant</strong> to create this vm). When I ssh into the vm I'm able to use the <strong>dig</strong> command line tool to access the DNS interface <strong>Consul</strong> provides. </p>
  
  <p>The thing is: I'd like to be able to access the DNS interface from my host machine. I've given a static IP to the vm but this did not resolve my problem. I also have opened port 53 of my vm, which also didn't resolve my problem. </p>
  
  <p>This is my <strong>Vagrant</strong> set-up script for my vm:</p>
  
  <pre><code>config.vm.define :app1 do |app1|
  # Every Vagrant virtual environment requires a box to build off of.
  app1.vm.box = "ubuntu/trusty64"
  
  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,
  # accessing "localhost:8080" will access port 80 on the guest machine.
  app1.vm.network :forwarded_port, guest: 3000, host: 3000
  app1.vm.network :forwarded_port, guest: 53, host: 53
  app1.vm.network :forwarded_port, guest: 8500, host: 8500
  app1.vm.network :forwarded_port, guest: 15672, host: 15672
  
  # Open 32 ports for Docker containers
  for port in 32768..32800
    app1.vm.network :forwarded_port, guest: port, host: port
  end
  
  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
  app1.vm.network :private_network, ip: "200.0.0.1"
  
  app1.vm.hostname = "server-1"
  
  config.vm.provider "virtualbox" do |v|
    v.memory = 1024
  end
  </code></pre>
  
  <p>This is how I've started a <strong>Docker-container</strong> with <strong>Consul</strong>:</p>
  
  <pre><code>sudo docker run --name consul -h $HOSTNAME -p 0.0.0.0:8300:8300 -p 0.0.0.0:8301:8301 -p 0.0.0.0:8301:8301/udp -p 0.0.0.0:8302:8302 -p 0.0.0.0:8302:8302/udp -p 0.0.0.0:8400:8400 -p 0.0.0.0:8500:8500 -p 0.0.0.0:53:53 -p 0.0.0.0:53:53/udp -d progrium/consul -advertise 200.0.0.1 -server -bootstrap
  </code></pre>
  
  <p>I've tried using the following with <strong>dig</strong> from my host machine:</p>
  
  <pre><code>dig @200.0.0.1 someservice.service.consul SRV
  </code></pre>
  
  <p>This responded with:</p>
  
  <pre><code>; &lt;&lt;&gt;&gt; DiG 9.9.5-3ubuntu0.2-Ubuntu &lt;&lt;&gt;&gt; @200.0.0.1 someservice.service.consul ANY
  ; (1 server found)
  ;; global options: +cmd
  ;; connection timed out; no servers could be reached
  </code></pre>
  
  <p>Is there any way I can make the <strong>Consul</strong> DNS interface accessible from my host machine? Any help will be appreciated.</p>