# Cannot get links alias to work

**URL:** <https://forums.suse.com/t/cannot-get-links-alias-to-work/3617>\
**Category:** Rancher 1.x\
**Created:** [August 3, 2016, 11:37am UTC](https://forums.suse.com/t/cannot-get-links-alias-to-work/3617 "2016-08-03T11:37:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Geir\_Gullestad\_Pette](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/geir_gullestad_pette/32/1562_2.png) [@Geir\_Gullestad\_Pette](https://forums.suse.com/u/Geir_Gullestad_Pette)\
**Post date:** [August 3, 2016, 11:37am UTC](https://forums.suse.com/t/cannot-get-links-alias-to-work/3617/1 "2016-08-03T11:37:12Z")

</div>

I have a docker-compose.yml file with 3 containers:

- zabbix-server - a web application
- zabbix-db - database
- zabbix-db-storage - database storage volume

zabbix-sever has a link to `zabbix-db` with alias `zabbix.db`:

```
zabbix-server:
  links:
    - zabbix-db:zabbix.db
  environment:
    - ZS_DBHost=zabbix.db

```

See file details here: [https://gist.github.com/geirgp/8982358d618d638cb98c20fed6581008](https://gist.github.com/geirgp/8982358d618d638cb98c20fed6581008)

When i run this locally by executing `docker-compose up -d` it works just fine. I can verify the link as follows:

```
$ docker exec -it zabbix_zabbix-server_1 /bin/bash
[root@e2de3f58855c /]# ping zabbix.db
PING zabbix.db (172.17.0.5) 56(84) bytes of data.
64 bytes from zabbix-db_1 (172.17.0.5): icmp_seq=1 ttl=64 time=0.181 ms
64 bytes from zabbix-db_1 (172.17.0.5): icmp_seq=2 ttl=64 time=0.076 ms

```

However, if I try to deploy it to rancher ( `rancher-compose up`) the `zabbix.db` alias does not seem to have a record in the internal rancher dns server:

```
$ docker exec -it r-zabbix_zabbix-server_1 /bin/bash
[root@3cebb6985b1e /]# ping zabbix.db
ping: unknown host zabbix.db

```

Pinging `zabbix-db` (service name) directly works, so I guess the link is there in a way:

```
[root@3cebb6985b1e /]# ping zabbix-db
PING zabbix-db.zabbix-server.zabbix.rancher.internal (10.42.132.243) 56(84) bytes of data.
64 bytes from 10.42.132.243: icmp_seq=1 ttl=64 time=0.192 ms
64 bytes from 10.42.132.243: icmp_seq=2 ttl=64 time=0.077 ms

```

How can I get the links alias to work?

---

<div class="post-metadata">

**Author:** ![AlexisDucastel](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/alexisducastel/32/894_2.png) [@AlexisDucastel](https://forums.suse.com/u/AlexisDucastel)\
**Post date:** [August 3, 2016, 2:59pm UTC](https://forums.suse.com/t/cannot-get-links-alias-to-work/3617/2 "2016-08-03T14:59:47Z")

</div>

Hi,

I’ve got the same scenario with a quite similar stack ! When using alias name, it uses /etc/resolv.conf “search” entry to complete short names for “ping” command. however, on the same container, if you install dnsutils and try to run a dig command with the same alias name, the dig will return the rancher ip address and confirm that the DNS server answering the request was rancher server.

Can you please test the dig command and give us your result ?

thanks.
