You are refering to setting up a virtual host.
Setting up a virtual host in Apache configuration file is not enough. For instance, you can set a virtual host "mysite.host" but entering a http://mysite.host/
in your Internet browser would not display a page. That's why you need a DNS server which will direct your browser to the correct server and then the web page will be delivered (without it, your browser does not know where to look for mysite.host).