The DNS server doesn't take ServerName from httpd.conf
Your browser doesn't route the request, the web server returns the correct page based in part on the Host HTTP Header sent by the browser.
When you type a URL in your browser and hit enter, the name is resolved to IP using DNS, and the browser sends an HTTP request to the IP returned from the DNS query.
HTTP headers form the core of the HTTP request. One of these is the Host, or domain name you typed in the browser.
Using an example Virtual Host definition.
<VirtualHost *:80>
ServerName example.com
DocumentRoot /var/www/example.com
</VirtualHost>
The ServerName directive within your Virtual Host configuration is matched against the Host HTTP Header. So if you type
http://example.com
Apache will receive the request and try to match the Host header
Host: example.com
with it's Virtual Host definitions. If it finds a a match, it will the use whatever is listed in the
DocumentRoot
In the example above
/var/www/example.com
This could be either an index file as defined within the configuration, or a directory index if they are permitted.
http://en.wikipedia.org/wiki/Virtual_hosting#Name-based