If I want to add an entry to /etc/hosts to resolve all traffic for example.com to 1.2.3.4, do I need to add1.2.3.4    example.com1.2.3.4    www.example.com1.2.3.4    smtp.example.com1.2.3.4    pop.example.com...Or will just adding1.2.3.4    example.comsuffice?
Should /etc/hosts contain the domain name or the FQDN?
networking;dns;internet;hosts
You will need to specify each and every subdomain. If that is not what you want, you should look into installing a real DNS server (e.g. bind9).This is rather easy to check by first adding just example.com to /etc/hosts and then do ping -c 2 example.comping -c 2 www.example.comThe first will succeed with the provided IP address. The second will go to 93.184.216.119 (the IP address in the internet for www.example.com)