If it is working for the IP but not the hostname perhaps you could try flushing your browser cache.
In any case, you should preferably add an entry to the hosts file (like mydrupal, for example) and add a virtualhost entry in /etc/apache2/sites-available/ and enable it.