hosts file: does it pass the domain name? I’m always redirected to the main site configured on the host

My server IP address is 123.456.789.123.

Pointing my browser to 123.456.789.123 (http://123.456.789.123) the server serves me site alpha.

Now I’ve configured a second site: beta.

Site beta is still online served from my old server with IP 321.987.654.321.

So, to reinstall and reconfigure it on the new server, I edited my hosts file this way, so it calls the new server when I go to domain beta.com:

## # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost 123.456.789.123 beta.com www.beta.com 

The problem is that when I point my browser to http://www.beta.com, I see alpha.com, the same site I see if I go to http://123.456.789.123.

On 123.456.789.123, I have two different vhosts file: one for alpha and one for beta.

They are like this:

<VirtualHost *:80>     # The ServerName directive sets the request scheme, hostname and port that     # the server uses to identify itself. This is used when creating     # redirection URLs. In the context of virtual hosts, the ServerName     # specifies what hostname must appear in the request's Host: header to     # match this virtual host. For the default virtual host (this file) this     # value is not decisive as it is used as a last resort host regardless.     # However, you must set it for any further virtual host explicitly.     ServerName alpha.com     ServerAlias www.alpha.com      ServerAdmin my.email@gmail.com     DocumentRoot /var/www/alpha.com/public_html      # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,     # error, crit, alert, emerg.     # It is also possible to configure the loglevel for particular     # modules, e.g.     #LogLevel info ssl:warn      ErrorLog /var/www/alpha.com/log/error.log     CustomLog /var/www/alpha.com/log/access.log combined      # For most configuration files from conf-available/, which are     # enabled or disabled at a global level, it is possible to     # include a line for only one particular virtual host. For example the     # following line enables the CGI configuration for this host only     # after it has been globally disabled with "a2disconf".     #Include conf-available/serve-cgi-bin.conf      # This will allow the use of .htaccess files to configure a single folder     <Directory /var/www/alpha.com>         AllowOverride All     </Directory> </VirtualHost> 

Any ideas about how can I see the site beta? It seems that the hosts file simply calls 123.456.789.123, but without passing the domain I’m asking for and so the server responds with the default one and not with the site I’m asking for: beta.com.