Ubuntu: How to do a redirect domain using NS record?


I saw familiar with this structure:

domain 1 ---> |
domain 2 ---> | domain 0 ---> server
domain 3 ---> |

Domains (1,2,3) refer to domain 0, when it is in the domains of (1,2,3) are spelled out NS.домен0.com. Ie comes very handy when you need a new domain to add only one entry in the NS.домен0.com NS in new domain.

I can't repeat this trick. 0 C Domain - the website can access, with Domain 1 no. In my case:
  1. Server
  2. Domain 0 - loustfillmstv.pw
  3. Domain 1 - joyukasonos.pw


<virtualhost loustfillmstv.pw:80> 
 ServerName loustfillmstv.pw 
 ServerAlias www.loustfillmstv.pw 
 ServerAdmin webmaster@localhost 
 DocumentRoot /var/www/html 

<virtualhost joyukasonos.pw:80> 
 ServerName joyukasonos.pw 
 ServerAlias www.joyukasonos.pw 
 DocumentRoot /var/www/html 

What am I doing wrong?
June 10th 19 at 14:46
2 answers
June 10th 19 at 14:48
I think I know that you saw something different.

The first domain:

nslookup -type=all loustfillmstv.pw
Non-authoritative answer:
loustfillmstv.pw internet address =
loustfillmstv.pw nameserver = ns1.reg.ru
loustfillmstv.pw nameserver = ns2.reg.ru
primary name server = ns1.reg.ru
responsible mail addr = hostmaster.ns1.reg.ru
serial = 1513334766
refresh = 14400 (4 hours)
retry = 3600 (1 hour)
expire = 604800 (7 days)
default TTL = 10800 (3 hours)

loustfillmstv.pw nameserver = ns1.reg.ru
loustfillmstv.pw nameserver = ns2.reg.ru

And the second domain:

nslookup -type=all joyukasonos.pw

DNS request timed out.
timeout was 2 seconds.
*** Request to myhost.local timed-out

Ie, no DNS of the world does not know the NS servers of your joyukasonos.pw.
And even when you add reg.ru NS servers - you will need to make A record with the new domain pointing to IP of your server.
June 10th 19 at 14:50
You have for these domains are defined the same:
DocumentRoot /var/www/html
therefore, when any request is made to Apache to send to the directory.
Affairs not in it, do a "ping joyukasonos.pw", it will be clear that this option will not work. The author of the question meant that even the same resource does not open. The reason for the lack of record in DNS for the domain joyukasonos.pw. - elizabeth_Russel commented on June 10th 19 at 14:53
It is clear that the domain joyukasonos.pw will not resolvida.
The question is crooked, the title of the issue there is a conversation about DNS, and then shows part of the Apache config. Confused confused, that the vehicle is necessary, whether he has two websites or one website and all the rest he needs to forwardit at first.
If he has two sites, in the Apache config error and will always open first, even if it configures the DNS for the second.
If a website loustfillmstv.pw and he needed to requests from browsers-clients on the other domains were redirected to the first, it need to configure DNS Forwarding. - nicklaus.OKeefe commented on June 10th 19 at 14:56

Find more questions by tags Domain name systemUbuntu Server* nix-like systems