The resolver asks the server named on the nameserver line. That line is what you fix: then every program on the machine gets addresses from the right server, for every name it knows.
An entry in /etc/hosts also yields an address, but for one name on one machine. The wrong nameserver stays in place, and the next name fails again. Such a workaround hides the fault, and the fault stays.
Point the system at the right server
Now the site api.lab.test does not open by name. The machine has two DNS servers. Find the one that knows this name and make curl http://api.lab.test:8080/health answer. Do not use /etc/hosts for this.
Goals · 0 of 2
- Point the system at the DNS server that knows the name not done yet
- Open the site by name not done yet