If I own a domain name (for example: mydomain.com), and I setup my own ns server ns1.mydomain.com with a public IP (for example: 1.2.3.4), I registered the ns1.mydomain.com to the registrar's system.
I have a record in my ns server: www.mydomain.com which points to a IP (for example: 1.2.3.5), if someone from Internet wants to access my www.mydomain.com, how do they know the ns server of my domain: ns1.mydomain.com is 1.2.3.4? Since they need to know that 1.2.3.4 contains all the data of my domain, but technically how do they know it?
When someone wants to access www.mydomain.com, they will get the ns server name (ns1.mydomain.com) from the registrar's system, but then how do they know it is 1.2.3.4?
Thank you!
*This is the first time I need to manage a self-own ns server
**Actually my domain has 2 ns servers and they have been running for years, but we need to change the public IP of ns2 soon. I need to understand more about it in order to make the changes without major problems/mistakes.