let's say you're a home desktop computer. what do you do to resolve some.name.com to an ip address?
- you contact a recursive dns server - you ask it what's the ip address of some.name.com by sending query for A or AAAA record. [in most cases you'll 'know' address of the recursive dns server from configuration passed via DHCP protocol, but possibly address of such server was entered manually together with ip address, gateway and netmask.]
- the recursive dns server checks if the entry is already in its cache, if it is and is not stale returns you this entry immediately. below i'll assume there's no data in cache.
- if the entry is not in cache it starts from the left-most part - com in our case. every recursive dns server has configured ip addreses of the root dns servers; your recursive dns server contacts randomly selected root name server and asks 'what's the ip address of server that can tell me about some.name.com'. asked server will not know that but will refer your recursive name server to the servers responsible for the com domain.
- your recursive name server will ask com domain servers again about some.name.com; those will not know about some.name.com but they will know about name.com and will return addresses of name servers responsible for it.
you can see order of dns queries for more complicated domain with few delegations here. for the record - this was a great dns visualization tool but it seems to be offline at the moment.
now let's say you're webmaster / server admin that wants to set up own domain some.name.com:
- you go to a registrar and buy name.com
- most registrars provide you free dns hosting but you prefer to do it your own way so instead of using web gui to enter dns records you delegate the domain to your own name servers
- you set up own dns server that will return information about entries within .name.com - you can set there A records [eg www.name.com->153.19.1.2], CNAME [eg www2.name.com->www.name.com], NS [eg - for anything within internal.name.com please following name servers] and other.
also take a look here.