M
M
Millerish2017-12-15 20:46:23
Domain Name System
Millerish, 2017-12-15 20:46:23

Ubuntu: How to redirect a domain via NS record?

Hello.
I saw this structure in my friends:

домен 1 ---> |
домен 2 ---> | домен 0 ---> сервер
домен 3 ---> |
...

Domains (1,2,3) refer to domain 0, while only NS.domain0.com is registered in domains (1,2,3). Those. it turns out very convenient, when a new domain appears, you need to add only one entry in NS.domain0.com to the NS of the new domain.
I can't replicate this trick. C Domain 0 - I can open the site, with Domain 1 no. In my case:
  1. Server - 185.174.173.169
  2. Domain 0 - loustfillmstv.pw
  3. Domain 1 - joyukasonos.pw

/etc/apache2/sites-enabled/000-default.conf:
<VirtualHost loustfillmstv.pw:80>                                                                                                                                  
        ServerName loustfillmstv.pw                                                                                                                                
        ServerAlias www.loustfillmstv.pw                                                                                                                           
        ServerAdmin [email protected]                                                                                                                            
        DocumentRoot /var/www/html                                                                                                                                 
</VirtualHost>                                                                                                                                                     

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

What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
akelsey, 2017-12-16
@akelsey

In my opinion, you saw something different with your friends.
First domain:

nslookup -type=all loustfillmstv.pw
Non-authoritative answer:
loustfillmstv.pw internet address = 185.174.173.169
loustfillmstv.pw nameserver = ns1.reg.ru
loustfillmstv.pw nameserver = ns2.reg.ru
loustfillmstv.pw
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

Those. no DNS in the world knows the NS servers of your joyukasonos.pw.
And even when you add the reg.ru NS server - you will need to make an A record with a new domain pointing to the IP of your server.

M
Moris Haos, 2017-12-16
@morihaos

Hello,
You have the same one defined for these domains:
therefore, for any request, Apache will direct to this directory.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question