0

I am running a LEMP webserver on my Raspberry pi using Rasbpian. The name of my my pi's hostname is raspi-host123.

My local hosts file on my server looks like this:

127.0.0.1       localhost loopback
::1             localhost ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters
127.0.1.1       raspi-host123 mysite.com www.mysite.com mail.mysite.com

I am wondering if the address of the Raspberry Pi should be integrated into my public resolvers so my hosts file instead looks like this:

My local hosts file on my server looks like this:

127.0.0.1       localhost loopback
::1             localhost ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters
127.0.1.1       raspi-host123.mysite.com raspi-host123.www.mysite.com raspi-host123.mail.mysite.com

Does the local hostname in my /etc/hosts file have anything to do with my domain names from my web server?

DanRan
  • 73
  • 1
  • 1
  • 12

1 Answers1

2

A proper hostname is usually a FQDN like "machine.example.net", not just "machine". However your system hostname doesn't need to appear in DNS, even it's often considered a good administration style. Also your hostname can be from a completely different domain than your websites (think of large webhosting providers).

rsc
  • 357
  • 1
  • 6