-1

I have dozens of undeveloped domains and I want them to display the same .php file for all of them by just pointing them to the same DNS:

ns1.example.com ns2.example.com

Both NS are pointing to my VPS IP address but pages are not working.

I want that any domain I configure with that DNS point to the VPS and display the same php file automatically.

I have Ubuntu Server 16.04 + nginx + php-fpm working fine.

How can I achieve this by just configuring nginx? Is it necessary to configure Bind? How?

Thanks in advance,

Mos.

MonMos
  • 1

1 Answers1

2

If you are using your own name servers for the domains, then you need to create a zone for each domain in your name servers.

In this zone, you create an A record for the domain name which points to the nginx server's IP address.

Then in nginx, you create a server block, which has the default_server option in the listen directive, and server_name _.

Tero Kilkanen
  • 34,499
  • 3
  • 38
  • 58
  • As I said I have dozens of domains (plus new ones everyday), I don't want to create a zone for each one or add them manually. I need that every time I set certain DNS in a domain, for example: ns1.example.com ns2.example.com All this domains show the same website, just like a parking page. How can I achieve that? I would appreciate a step by step explanation. – MonMos Mar 22 '17 at 10:32
  • Then you have to make the creation of zones automatic. That is simply the way DNS works. – Tero Kilkanen Mar 22 '17 at 23:51