Jorge
Jorge

Reputation: 79

Can I stick with server_name directive from nginx or do I still need to set DNS in linux?

I am learning nginx and I have this doubt. Do I need to setup a dns in linux (/etc/resolv.conf) or can I just stay with what nginx uses inside its directive server_name?

Upvotes: 0

Views: 35

Answers (1)

Ron
Ron

Reputation: 6621

You can set nginx to listen to ANY domain pointed to that web server with:

listen       80  default_server;

or you can be specific via server_name. Check Nginx docs

Setting DNS on the webserver itself does not help much..

Adding the entry in your visitor's PC hosts file can override a domain name's A record pointer to the one specified by you.

Upvotes: 1

Related Questions