Not sure if you've already done it but exact same for linux machine only difference of course is the file, which is
/etc/hosts
if it's the actual machine that's hosting the website just add
www.mysite.com to what's already there, ending up something like that
127.0.0.1
www.mywebsite.com localhost.localdomain localhost