aacebedo / dnsdock

DNS service discovery for Docker containers
MIT License
608 stars 91 forks source link

Wrong A records when using n-th depth domain names #55

Open paolomainardi opened 8 years ago

paolomainardi commented 8 years ago

Version: tonistiigi/dnsdock:v1.10.0

Docker-compose file:

drupal:
  build: .
  dockerfile: Dockerfile.loc
  volumes_from:
    - data
  links:
    - mariadb
    - solr
    - redis
    - blackfire
  environment:
    - DNSDOCK_ALIAS=www.docker.sparkfabrik.docker.loc
  restart: always
mariadb:
  extends:
    file: docker-compose.common.yml
    service: mariadb
  volumes_from:
    - data
  environment:
    - DNSDOCK_ALIAS=mysql.www.docker.sparkfabrik.docker.loc

DIG output:

~ ❯ dig @172.17.42.1 mysql.www.docker.sparkfabrik.docker.loc

; <<>> DiG 9.8.3-P1 <<>> @172.17.42.1 redis.www.docker.sparkfabrik.docker.loc
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 17281
;; flags: qr rd; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;redis.www.docker.sparkfabrik.docker.loc. IN A

;; ANSWER SECTION:
mysql.www.docker.sparkfabrik.docker.loc. 0 IN A 172.17.42.7
mysql.www.docker.sparkfabrik.docker.loc. 0 IN A 172.17.42.3

Where 172.17.42.7 is the ip of the drupal container.

Any ideas ?

asjustas commented 8 years ago

I think problem is in https://github.com/tonistiigi/dnsdock/blob/master/dnsserver.go#L446

jverdeyen commented 8 years ago

Any update on this issue? I've experienced the same problem.