In a production environment (that is, on a server that is directly accessible via the internet), you would normally add a Domain Name Service (DNS) entry using the services of your Internet Service Provider (ISP). For development purposes, however, you can simulate a DNS address by adding an entry to the hosts file on your own local computer. For Linux and macOS computers, the file is located at /etc/hosts. For Windows computers, the file is located at C:\Windows\System32\drivers\etc\hosts. For our fictitious company Book Someplace, we add the following entry to the local hosts file:
172.16.0.11 learning.mongodb.local
At this point, from your host computer, in a Terminal window or Command Prompt from outside the Docker container, test the connection using ping learning.mongodb.local, as shown here:
And that concludes the setup instructions for the book.