T
T
Tyoma Makeev2016-01-14 09:27:04
Nginx
Tyoma Makeev, 2016-01-14 09:27:04

If you set localhost as a resolver in the nginx settings, will it be possible to resolve through /etc/hosts?

If you set the resolver to 127.0.0.1 in the nginx settings, will it be possible to resolve through /etc/hosts, or do you need to raise the DNS server?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Valery Ryaboshapko, 2016-01-14
@murmuringvoices

If you want to use /etc/hosts, no special settings are needed. If the application does not have its own resolver and makes a request to the OS, then the OS looks there first of all.
I'm not sure if nginx has its own resolver, but if you tell it to use 127.0.0.1 as the DNS server, then it will knock on port 53 there, and, obviously, someone should listen and respond to requests on this port.
UPD: Yes, indeed there is a resolver directive, for its execution it is necessary to raise the DNS server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question