Hands-on task
DNS in Docker: name, alias and resolver
The app network runs the database db-v2 and the reporting service report. In report's settings the database is written as db (UPSTREAM=db:8080), and since the move to db-v2 reports are broken: report's /call answers 502.
Make the name db in the app network lead to the db-v2 container. Don't recreate or rename either container: report has a queue building up, and other services expect db-v2 under that name.
While you're at it, find out which DNS server the report container queries and write its address (IP only) to /root/resolver.txt.
The lab has its own Docker with no internet access; the images are already loaded: izzylab/minihttp:1, alpine:3.21, busybox:1.36, nginx:1.27-alpine. izzylab/minihttp is a tiny HTTP service on port 8080: GET / answers <NAME> ok, GET /call itself goes to http://<UPSTREAM>/ and answers <NAME> -> <the neighbor's reply> (or 502), GET /env shows its settings. It is configured with the environment variables NAME, PORT, BIND (the address it listens on) and UPSTREAM.
- docker dns
- network alias
- resolv.conf