The resolving name server doesn't know the location of the entire domain, but it does know where the root name server is, so that's where it sends the query first.
The root name server will then tell the resolving name server the location of the top-level domain name server, so that's the next place the resolving name server sends the query.
The top level domain name server, which is updated by the domain registrar, will then be able to direct the query to the authoritative name server, which is usually just referred to as the "name server" of a domain.
This name server knows the location of the IP of the domain, and sends this information back to the resolving name server, which caches the information and routes the browser to the correct place.