Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

212
Visualizações
is possible to link a DNS name to another DNS name in docker?

I'm kind of new on docker. I want to resolve DNS name into something define by the user. I mean, I have a service in docker which requires another service located in 'myEndpoint'. I want to configure that when the service asked to 'myEndpoint' returns an IP/FQN I decide, either in the containers or outside.

How I can do this?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

If you just want to map myEndpoing to a specific IP, you could use option --add-host when docker run ... your container. Take a look at the following example:

 ~/ docker run --add-host=myEndpoint:123.124.125.126 --rm alpine:3.3 ping myEndpoint -c 4
PING myEndpoint (123.124.125.126): 56 data bytes
64 bytes from 123.124.125.126: seq=0 ttl=37 time=0.522 ms
64 bytes from 123.124.125.126: seq=1 ttl=37 time=0.391 ms
64 bytes from 123.124.125.126: seq=2 ttl=37 time=2.161 ms
64 bytes from 123.124.125.126: seq=3 ttl=37 time=0.488 ms

--- myEndpoint ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 0.391/0.890/2.161 ms

You can refer to the docs of docker run for more details.

But if you want to map myEndpoint to other domain name, I think you need to use a FQDN and configure it as a CNAME DNS record, then configure DNS server for your container with option --dns options when you do docker run .... Hope this could be helpful :)

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda