I'm running Apache/2.4.41 on Ubuntu 20.04. I'm trying to setup a virtual host. Neither Chrome nor Firefox are able to resolve hostnames specified in /etc/hosts file. Even before setting up the test.dev.conf file at /etc/apache2/sites-available, the browsers are not able to resolve the hostname. I'm trying to add test.dev.
Contents of /etc/hosts
127.0.0.1 localhost
127.0.0.1 test.dev
127.0.1.1 lakeguardians
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
I'm able to ping the host though. Running the ping -c 5 test.dev gives the following output:
--- test.dev ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4073ms
rtt min/avg/max/mdev = 0.041/0.045/0.047/0.002 ms
Contents of /etc/nsswitch.conf
hosts: files mdns4_minimal [NOTFOUND=return] dns
I've tried restarting apache2 and rebooting the system, but unable to solve the issue.
.local
. The extension.dev
is reserved by Google and this reservation is hard-codded within the most browsers.