weixin_39943678
weixin_39943678
2020-12-27 05:12

Unable to resolve host error

So when I'm attempting to launch mesos-dns, it fails when it is unable to resolve the physical IP of another slave VM. However, when I use dig and point it at the resolver to find the IP of the slave VM, it works. How is mesos-dns forwarding the DNS query to the resolver?


vagrant:/vagrant/share⟫ sudo docker run -t -i mesosphere/mesos-dns /usr/bin/mesos-dns -v=2 
VERY VERBOSE: 2015/04/23 17:17:15 config.go:148: Mesos-DNS configuration:
VERY VERBOSE: 2015/04/23 17:17:15 config.go:150:    - Masters: 10.10.10.11:5050
VERY VERBOSE: 2015/04/23 17:17:15 config.go:155:    - RefreshSeconds:  60
VERY VERBOSE: 2015/04/23 17:17:15 config.go:156:    - Domain: mesos
VERY VERBOSE: 2015/04/23 17:17:15 config.go:157:    - Listener: 0.0.0.0
VERY VERBOSE: 2015/04/23 17:17:15 config.go:158:    - Port:  53
VERY VERBOSE: 2015/04/23 17:17:15 config.go:159:    - DnsOn:  true
VERY VERBOSE: 2015/04/23 17:17:15 config.go:160:    - TTL:  60
VERY VERBOSE: 2015/04/23 17:17:15 config.go:161:    - Timeout:  5
VERY VERBOSE: 2015/04/23 17:17:15 config.go:162:    - Resolvers: 10.10.10.11
VERY VERBOSE: 2015/04/23 17:17:15 config.go:163:    - ExternalOn:  true
VERY VERBOSE: 2015/04/23 17:17:15 config.go:164:    - SOAMname: ns1.mesos.
VERY VERBOSE: 2015/04/23 17:17:15 config.go:165:    - SOARname: root.ns1.mesos.
VERY VERBOSE: 2015/04/23 17:17:15 config.go:166:    - SOASerial:  1429809435
VERY VERBOSE: 2015/04/23 17:17:15 config.go:167:    - SOARefresh:  60
VERY VERBOSE: 2015/04/23 17:17:15 config.go:168:    - SOARetry:  600
VERY VERBOSE: 2015/04/23 17:17:15 config.go:169:    - SOAExpire:  86400
VERY VERBOSE: 2015/04/23 17:17:15 config.go:170:    - SOAExpire:  60
VERY VERBOSE: 2015/04/23 17:17:15 config.go:171:    - RecurseOn:  true
VERY VERBOSE: 2015/04/23 17:17:15 config.go:172:    - HttpPort:  8123
VERY VERBOSE: 2015/04/23 17:17:15 config.go:173:    - HttpOn:  true
VERY VERBOSE: 2015/04/23 17:17:15 config.go:174:    - ConfigFile:  /config.json
VERY VERBOSE: 2015/04/23 17:17:15 generator.go:180: reloading from master 10.10.10.11
ERROR: 2015/04/23 17:17:15 generator.go:213: cannot translate hostname mesosslave2
2015/04/23 17:17:15 Recovered from panic: runtime.errorCString{cstr:0xb2d8f3} (runtime error: invalid memory address or nil pointer dereference)
/build/src/github.com/mesosphere/mesos-dns/util/util.go:47
/build/src/github.com/mesosphere/mesos-dns/util/util.go:38
/usr/lib/golang/src/pkg/runtime/panic.c:248
/usr/lib/golang/src/pkg/runtime/panic.c:552
/usr/lib/golang/src/pkg/runtime/os_linux.c:237
/build/src/github.com/mesosphere/mesos-dns/records/generator.go:215
/build/src/github.com/mesosphere/mesos-dns/records/generator.go:84
/build/src/github.com/mesosphere/mesos-dns/resolver/resolver.go:134
/build/src/github.com/mesosphere/mesos-dns/main.go:86
/usr/lib/golang/src/pkg/runtime/proc.c:1445

Dig resolves correctly:


vagrant:/vagrant/share⟫ dig mesosslave2 .10.10.11


; <<>> DiG 9.9.5-3ubuntu0.2-Ubuntu <<>> mesosslave2 .10.10.11
;; global options: +cmd
;; Got answer:
;; ->>HEADER<

该提问来源于开源项目:mesosphere/mesos-dns

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

6条回答

  • weixin_39670464 weixin_39670464 4月前

    Hi ,

    let's debug this. Please tell me the following: - what are the contects of /etc/resolv.conf in the mesosslave1 machine - what do you get when you run "dig mesosslave2" without the ".10.10.11" This will help me track what the issue you are having in generator.go:213

    Seperately, I think you caught a bug in https://github.com/mesosphere/mesos-dns/blob/master/records/generator.go#L215 I will look into this soon.

    点赞 评论 复制链接分享
  • weixin_39943678 weixin_39943678 4月前

    I solved this error by swapping out the base docker image in mesos-dns-pkg/docker from 'scratch' to 'debian'. It seems that the scratch image was not able to read in the hostnames from /etc/hosts or query the forwarding DNS server. I don't currently have access to my test machine but I'll post the dig results later today.

    点赞 评论 复制链接分享
  • weixin_39539733 weixin_39539733 4月前

    Instead of basing on debian you could try basing on busybox:ubuntu-14.04: https://registry.hub.docker.com/_/busybox/

    On Fri, Apr 24, 2015 at 10:06 AM, Han Wang notifications.com wrote:

    I solved this error by swapping out the base docker image in mesos-dns-pkg/docker from 'scratch' to 'debian'. It seems that the scratch image was not able to read in the hostnames from /etc/hosts or query the forwarding DNS server. I don't currently have access to my test machine but I'll post the dig results later today.

    — Reply to this email directly or view it on GitHub https://github.com/mesosphere/mesos-dns/issues/138#issuecomment-95943909 .

    James DeFelice 585.241.9488 (voice) 650.649.6071 (fax)

    点赞 评论 复制链接分享
  • weixin_39670464 weixin_39670464 4月前

    There seem to be 3 somewhat independent issues going on here: - docker issues - configuration issues (not sure) - and L215 in generator.go is flaky imho.

    点赞 评论 复制链接分享
  • weixin_39670464 weixin_39670464 4月前

    The issue about L215 in generator.go is related to #151. Let's fix them together

    点赞 评论 复制链接分享
  • weixin_39539733 weixin_39539733 4月前

    to be clear, L215:

     go
    rg.Slaves[slave.Id] = t.IP.String()
    
    点赞 评论 复制链接分享

相关推荐