I just cut over DNS for a .com web site to become live. Does my production web server need its domain name in its hosts file? Like this
127.0.0.1 www.mydomain.com mydomain.com
127.0.0.1 api.mydomain.com
Or can I leave that out?
I just cut over DNS for a .com web site to become live. Does my production web server need its domain name in its hosts file? Like this
127.0.0.1 www.mydomain.com mydomain.com
127.0.0.1 api.mydomain.com
Or can I leave that out?
If you want to resolve it's fqdn by hosts file, not from internet, then yes. If you trust in dns provider, then it is not needed. (In the first case you can avoid some dns based errors, otherwise local name resolution will be independent from network.) I can't give you a rock solid advice, but when I install a server, then I don't think it is needed by reason. However it can't hurt really, just can make hard to debug - but you can choose what is the preferred way for you.