I'm learning about Active Directories.
I understand when a computer wants to join a domain, it needs to change his DNS settings to that of the Domain Controller IP address. Then only it can see the Domain Controller, and join in
I find this rather weird and I can't get my head around this.
Why can't the DC connection work like any other client-server application? I.e. the client specifies the IP address of the server, Click connect, and joins the domain.
My Question
What's the logic behind this?
What happens when one wants to use a different (both primary and secondary) DNS server?
This isn't actually correct. You need to have your client (the machine you want to join the domain) be using a DNS server (or servers) that knows all the records for the AD domain; that doesn't have to be a DC. In many environments, its really easy to simply make the Venn diagram of all of your DCs and all of your DNS servers be a single overlapping circle, but there's no requirement.
The requirement is that your client use DNS servers that can serve all the AD domain's records - of which there are a lot.
If you have the client using a primary DNS that does have those records, and a secondary DNS that doesn't (for example, a public DNS provider), then AD-related lookups will fail on your client if it ever has cause to not get an answer from the primary. Don't do that.
Because, as Michael Hampton said above, so much in AD (and dependent technologies) depends on DNS records, more than just needing the IP of a single DC. The AD login process itself needs to know about AD sites, which are defined in DNS. DFS uses a lot of DNS records, as does Exchange.