This problem is almost unrelated to software development, is more of network administration and IT.
This is possible because you can configure several IP addresses on the same host. As the question is, most likely, related to Windows, you can find further detail like this: http://bit.ly/1poqmeG
Now, as to the domain names, the problem is still reduced to IP addresses, because domain system is nothing but mapping of the set of domain names onto the set of IP addresses, always. It is set up by updating DNS data. To understand how it works, please see: