Skip to content
This repository was archived by the owner on Jan 1, 2021. It is now read-only.
This repository was archived by the owner on Jan 1, 2021. It is now read-only.

DNS (SRV records) lookups fail inside docker container using boot2docker DNS server. #627

Closed
boot2docker/boot2docker-cli
#316

Description

@buckett

If I do a DNS lookup for s SRV record inside a docker container using the DNS resolved supplied by boot2docker it fails:

$docker run --rm -it ubuntu /bin/bash -c "apt-get update; apt-get install -y dnsutils; host -t SRV _kerberos._udp.ox.ac.uk"

if I switch to using external DNS (Google in this case) it all works:

docker run --rm -it --dns 8.8.8.8 ubuntu /bin/bash -c "apt-get update; apt-get install -y dnsutils; host -t SRV _kerberos._udp.ox.ac.uk"

Activity

  1. buckett commented on Nov 13, 2014

    @buckett
    Author

    Ok, I think this is because the boot2docker VM is using the virtualbox host based resolver to do it's DNS lookups, this server doesn't seem to support SRV requests. If you switch to the plain DNS proxy then the lookups start working again:

    VBoxManage modifyvm "boot2docker-vm" --natdnshostresolver1 off
    VBoxManage modifyvm "boot2docker-vm" --natdnsproxy1 on
    

    Is there a reason for preferring the resolver over the proxy?

    http://www.virtualbox.org/manual/ch09.html#nat-adv-dns

  2. SvenDowideit commented on Nov 14, 2014

    @SvenDowideit
    Contributor

    this may be documented in the original b2d repo PR's (when the cli was a script) - I can't recal atm

  3. buckett commented on Nov 14, 2014

    @buckett
    Author

    This may well catch quite a few people out as DNS SRV records are used for quite a few things such as SIP, XMPP, Kerbers, etc (http://en.wikipedia.org/wiki/SRV_record#Usage)

  4. SvenDowideit commented on Nov 17, 2014

    @SvenDowideit
    Contributor

    @tianon can we look into this before 1.4?

  5. added this to the 1.4.0 milestone on Nov 17, 2014
  6. tianon commented on Nov 17, 2014

    @tianon
    Contributor

    Is this something we choose explicitly, or something we inherited as a default setting from VirtualBox?

  7. SvenDowideit commented on Nov 18, 2014

    @SvenDowideit
    Contributor

    I'm not sure atm, I think I only went with what someone else mentioned worked for them - but i'm not 100% sure.

  8. tianon commented on Nov 26, 2014

    @tianon
    Contributor
  9. tianon commented on Nov 26, 2014

    @tianon
    Contributor

    If we omit the flag, here's what we get:

    <DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>

    Anyone suffering from this willing to test something like the following?

    $ VBoxManage modifyvm boot2docker-vm --natdnshostresolver1 off --natdnsproxy1 off
  10. buckett commented on Nov 27, 2014

    @buckett
    Author

    @tianon That works for me, but the tradeoff of no using the host resolver or proxy is that people running boot2docker on laptops may end up with broken DNS inside their VMs when they move between networks that have different DNS resolves setup I don't believe the change in DNS settings gets pushed through to the VM.

  11. SvenDowideit commented on Nov 28, 2014

    @SvenDowideit
    Contributor

    mmm, that'll be an interesting tradeoff :/

  12. buckett commented on Nov 28, 2014

    @buckett
    Author

    My summary of the options:

    • No DNS proxy -- Works well without issues except for people who use boot2docker on laptops and move them across networks with different DNS servers (eg home / work).
    • NAT DNS Host Resolver -- The current setting but doesn't appear to support SRV records (feature request for Virtualbox)?. Does however hide the upstream DNS so travelling laptops work fine.
    • NAT DNS Proxy -- An alternative setting that hides the upstream DNS from the VM so laptops work fine and DNS SRV records also work here.

    Is there a reason not to use the NAT DNS Proxy?

  13. SvenDowideit commented on Dec 1, 2014

    @SvenDowideit
    Contributor

    it sure sounds better - we'll probably only find out if there are problems after we release with it :)

  14. tianon commented on Dec 1, 2014

    @tianon
    Contributor

    Indeed. Thanks for the summary @buckett. I'll work up a PR to switch to the DNS Proxy and we can always switch over to no proxy if it turns out there are other glaring issues with the proxy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions