4

First, I will describe the problem: I have a domain portfolio website. Every domain have a forsale page like this:

www.myportfoliosite.com/thedomainforsale.com

I want to park my domains but I need only a simple redirection to our for sale page. I think this solution has two steps:

  1. Configure your server (cent-os, Apache 2.2 and WHM/cPanel) and/or DNS to accept all domains that use our specific nameservers.

  2. Redirect all domains to their for sale page.

I think I can solve the step 2 using .htaccess. Now, I want to solve step 1 via this question. So,

Is it possible to configure the server or set up a DNS to accept all domains that use our specific parking nameservers like park1.myportfoliosite.com and park2.myprotfoliosite.com.

Note: Our current domain and nameservers work normally. So, I can create new nameservers or I can create a new cPanel account and use my another domain myportfoliosite.NET to create a specific configuration.

MrWhite
  • 11,643
  • 4
  • 25
  • 40

1 Answers1

2

Normally, a name server is authoritative for certain domains and can allow recursion for the rest. That's the normal behavior of a name server. With BIND, this is done using hint type zone (see Caching Name Servers):

zone "." {
        type hint;
        file "/etc/bind/db.root";
};

If you simply don't need to use this server recursively on any client, and are willing to disobey the normal practices, it would be possible to make your name server answer authoritatively on every query by making it as a Master (Primary) Name Server for root .:

zone "." {
        type master;
        file "/etc/bind/db.root.authoritative";
};

And creating a fake root zone (/etc/bind/db.root.authoritative) e.g.:

$ORIGIN .
@    IN   SOA  ns1.example.com. hostmaster.example.com. 2017103002 1800 900 604800 86400
@    IN   NS   ns1.example.com.
@    IN   NS   ns2.example.com.

@    IN   A    203.0.113.10
*    IN   A    203.0.113.10

Where:

  • example.com could be the domain of your portfolio site
  • ns1.example.com and ns2.example.com are the actual name servers, configured at registar
  • 203.0.113.10 is the IP of your webserver

Because of the *. your name server will now answer authoritatively to every query; it will answer 203.0.113.10 for every.subdomain.example.net. A you ever have.

As you are already breaking the rules, you don't necessarily need to configure zone transfers between your name servers for this . zone, but you can simply configure both servers as masters.

Esa Jokinen
  • 43,252
  • 2
  • 75
  • 122
  • Thank you very much for your detailed answer. Everything is clear however I may need a freelancer to apply your solution. :) – user3620931 Oct 31 '17 at 11:19
  • This is helpful, to implement this should we have bind dns server installed, apprectiate any links for such is provided. – Bharath Apr 19 '19 at 17:40