Answers: <p>You have to bind server's port to something else when running it's container, using the <code>--publish</code> or <code>-p</code> flag.<br />
  Take a look at examples and documentation <a href="https://docs.docker.com/config/containers/container-networking/" rel="nofollow noreferrer">here</a>.</p>
  
Answers: CC BY-SA 4.0
Answers: 2021-09-16T06:49:23.987Z
Answers: 2021-09-16T06:49:23.987Z
Answers: storm
Body: <p>I was wondering if it was possible to assign the DNS server a docker container is querying (via docker run --dns, or otherwise) to be on a specific port, something other than 53? I had built a custom python based DNS server for a specific use case and don't have the option to run the container it resides in on the traditional TCP/UDP port 53 (issue with Apache MESOS Marathon unfortunately). Docker image the server is built on is python:3.6.12-slim-buster.</p>
  
Tags: <docker><networking><dns>
Title: Point docker container DNS to specific port?
UserDisplayName: Klaus
ThreadText: # Point docker container DNS to specific port?
  
  (Asked by: username_0 on 2021-09-14)
  
  I was wondering if it was possible to assign the DNS server a docker container is querying (via docker run --dns, or otherwise) to be on a specific port, something other than 53? I had built a custom python based DNS server for a specific use case and don't have the option to run the container it resides in on the traditional TCP/UDP port 53 (issue with Apache MESOS Marathon unfortunately). Docker image the server is built on is python:3.6.12-slim-buster.
  
  **Tags:** docker, networking, dns
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-09-16. Score: 1
  
  You have to bind server's port to something else when running it's container, using the `--publish` or `-p` flag.  
  Take a look at examples and documentation [here](https://docs.docker.com/config/containers/container-networking/).
  
  
  ---
  
  