Score:-2

Connecting subdomain to a server as hostname

in flag

I have my website (mydomain.com) connected with a vps server and now I want to setup another server and use subdomain from main domain for hostname as well the nameservers (e.g. srv1.mydomain.com should point to new server, ns3.mydomain.com and ns4.mydomain.com new server nameservers). I have created both nameservers (ns3, ns4) and pointed to new server IP address on domain provider, and I think it does one part. But I am unsure about the other part. I tried to add dns record on older server for the host srv1.mydomain.com and pointed to new server IP but it did not worked, but it did not worked. When I queried the dns record of "srv1.mydomain.com" in a tool, it shows error "DNS record not found, reported by ns1.mydomain.com".

I am pretty sure, I am missing some crucial step. Any suggestion, resource or guide please?

Update: (Example Scenario)

I own a domain "example.com" and I want it to be used with two different servers. The "srv1.example.com" will point to a server with IP address "10.10.10.100" and should use these nameservers (ns1.example.com, ns2.example.com).

On the other hand, I want to connect "srv2.example.com" with second server "10.10.10.200" and it will serve under these nameservers (ns3.example.com, ns4.example.com).

The actual domain "example.com" needs to be hosted on first server "10.10.10.100".

PS: apologies for not sharing real domains, the company privacy doesn't allow that for privacy reasons.

Patrick Mevzek avatar
cn flag
If you want to delegate part of your zone to another nameservers you need to enter proper `NS` records on parent, and hence the same + `SOA` on children nameservers. But this is not absolutely needed just to have a "subdomain". You can enter its IP addresses directly in the zone, no matter how deep it is in terms of labels, you do not necessarily need to delegate to other nameservers. Besides that you are not giving the real name and you are badly obfuscating so noone can really assist your specific case. You may want to use online troubleshooting tools like DNSviz or Zonemaster to debug.
Alena avatar
in flag
@PatrickMevzek thanks for your comment, sorry it is little confusing but I have added more details. Please check that, hopefully it will give you full picture.
djdomi avatar
za flag
take a look into http://www.zytrax.com/books/dns/ch9/delegate.html in case its bind9
Patrick Mevzek avatar
cn flag
@Alena it is not very much clearer. Still vague why you need to delegate at all. Also if you used real names things would be far more simpler. You need to understand how DNS delegation works, I think you are confused by that, and you can't have `srv1` and `srv2` at the same node served by different nameservers
Alena avatar
in flag
@djdomi thanks for sharing.
Alena avatar
in flag
@PatrickMevzek I have saw this being used on several places, anyway, thanks for your help.
djdomi avatar
za flag
@Alena only that you see that, doesn't mean its better. Why you not explain why you want to have this, instead a single point where to update anything
Alena avatar
in flag
@djdomi I bought a dedicated domain for the server purposes, and have multiple servers and this seems good option to serve multiple servers from one domain.
djdomi avatar
za flag
@Alena i own round about 25 Servers and about 30 Domains, and only using 3 NAmeservers, and not screwing each server with a additional nameserver - for what reason? I manage it central even if i need more sub Domains, i just add them to the Zonefile
Alena avatar
in flag
@djdomi can you please share your setup details?
Score:0
za flag

On Request of Alena, i will show my DNS-zone

$TTL    3D
@       IN      SOA     ns400.domain.net. dnsdmin-email.domain.net. (
                        2020051801      ; Serial
                        10800   ; Refresh
                        3600    ; Retry
                        604800  ; Expire
                        10800 ) ; Minimum

domain2.net.                            IN NS   ns400.domain.net.
domain2.net.                            IN NS   ns401.domain.net.
domain2.net.                            IN NS   ns402.domain.net.
*.domain2.net.                          IN A    1.2.3.4
domain2.net.                            IN A    1.2.3.4
*                                       IN AAAA aaaa:aaaa:aa:23d::1
                                        IN A    1.2.3.4
                                        IN AAAA aaaa:aaaa:aa:23d::1
domain2.net.                            IN MX   10 mx.domain.net.
subdomain2.domain2.net.                 IN A    1.2.3.4
subdomain3.domain2.net.                 IN A    1.2.3.5
subdomain4.domain2.net.                 IN A    1.2.3.6
srv.subdomain4.domain2.net.             IN A    1.2.3.7
srv.subdomain4.domain2.net.             IN AAAA aaaa:aaaa:aa:23d::666

$ORIGIN @

As you see, there are 3 NS used for one domain, but all changed can be done within here. This zone has a Catchall and a Sub-Domain defined, and is also avaible for IPv4&6 for the Catchall

Alena avatar
in flag
thanks for sharing your dns file. I can see it is serving multiple nameservers but all records are pointing to one server (1.2.3.4) and I still don't understand; how is it linking the multiple servers together.
djdomi avatar
za flag
1.2.3.4 can be any ip. you could use subdomain2.domain2.net with 4.3.2.1 and then it will resolve subdomain2 to 4.3.2.1 or any other ip you set
djdomi avatar
za flag
i edtir my answer, to show you, that it would not make sense, to use for each server a other nameserver, which would make the things reaaaly complicated, instead you have one zonefile and can update from here any changes - as example srv will resolv to .7 but subdomain4 to .6 and in any other case to .4
djdomi avatar
za flag
and however, you will not be able to use one physical server to use as 2 Nameserver. No registry will accept that, 2 servers and 2 ips are at least required
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.