Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What is the –domainname option used for in Docker?

I’ve been searching the web back and forth and just couldn’t find something informative enough about the --domainname in docker run

What is the meaning of it? What effect does it have?

I’m trying to run this docker-compose.yaml file:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

version: "3.9"
services:
  server:
    domainname: myexample.com
    hostname: myserver
    image: "net-utils:0.3"
    command: ["tail", "-f", "/dev/null"]
  client:
    domainname: myexample.com
    hostname: myclient
    image: "net-utils:0.3"
    command: ["tail", "-f", "/dev/null"]

And now from within the container:

root@myclient:/# ping myserver.myexample.com
ping: myserver.myexample.com: No address associated with hostname
root@myclient:/# ping server.myexample.com
ping: server.myexample.com: No address associated with hostname

So what is the use of it?

>Solution :

The --domainname option has nothing to do with DNS or hostnames. From the docker run man page:

       --domainname=""
          Container NIS domain name

       Sets the container's NIS domain name (see also setdomainname(2)) that is
          available inside the container.

It sets the NIS domainname, which is only relevant if you’re using NIS, which these days isn’t all that likely.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading