My question is that suppose my website is \"xyz.com\" I can access it anywhere in the world, but I\'m curious to know how does all the dns servers know the ip address of my
When a request comes in the name server can do the following four thing with it. (1)It can answer the request with the IP address because it already the IP Address. (2)It can contact another name server and try to find the ip address for the name requested. It may have to do this with multiple times. (3)I t can say “ I don’t know the IP address for the name you requested. But here is the IP address for the name server that know more than I do. (4)It can return Error message the requested domain is invalid or does not exist.
for more explanation read full article here
https://www.computersciencejunction.in/2019/04/domain-name-system-introduction.html