My wife recently IMed me from work wanting a simple explanation of how DNS works. Here is what I came up with to send to her. There are other nuances to DNS and features that could fill a book but this should explain the basics of name to IP mapping in DNS with ptr records.

domain name address Server address
www.domain.com -> 192.251.94.101
domain.com -> 192.251.94.101

Notice that both domain names point to the same server. Because of that both domain names will display the same site.

If you were to have something like:

domain name address Server address
www.domain.com -> 192.251.94.101
domain.com -> 192.251.94.101
ww2.domain.com -> 192.251.94.102

Notice that ww2.domain.com points to a different server.

Sometimes it’s necessary to have a server for the primary web site and have other servers for other functions on the web site. Those other “subsites” would normally require their own domain name address like ww2.domain.com