0

I'm really confused by FQDN. So there is this file on my debian machine /etc/hosts. What exactly goes in there?

Say my VPS is located at ipadress: 39.22.11.99 And i have a couple of domains all pointing to this ip adress. Let's say: domainA.com, domainB.com, domainC.com

Those 3 domains do each server another purpose and are correctly configured with Nginx to point to the correct data say: websiteA, websiteB, websiteC

I have one mail server running on my VPS working and all. Yet somehow i think my /etc/hosts file is not configured correctly as all the mail goes into my spam folder even while i have an SSL certificate for all 3 domains and subdomains.

How would one configure his /etc/hosts file? And should virtual hosts/users help me sending mails from different domains?

For now my /etc/hosts file looks like this:

127.0.0.1    localhost           SomeAlias
39.22.11.99  domainA.com         SomeAlias
39.22.11.99  mail.domainA.com    SomeAlias
39.22.11.99  domainB.com         SomeAlias
39.22.11.99  domainC.com         SomeAlias    
Baklap4
  • 127
  • 1
  • 13

1 Answers1

1

A FQDN is just a format for representing a dns record, like it's the entire dns record without any shorthand or assumptions about what domain the machine is part of. Anyway, it's traditional to stick the hostname of your machine in the /etc/hosts file. You don't have to, but it prevents the machine from having to DNS lookup it's own name all the time, so it makes sense. So as far as your hostname goes, you can just go with whatever your host gave you, or you can set it to something yourself. You should have your ISP/Provider set the reverse DNS for your hostname, since a lot of mail servers won't accept mail from servers that have a mixup between their rdns, dns, and their hostname.

TL;DR: The /etc/hosts file just hardcodes ip addresses. A FQDN is just a full dns record. You're wondering about setting a valid hostname. You can actually use any of your domains, or mail.yourdomains.com or whatever you want really.

Some Linux Nerd
  • 3,157
  • 3
  • 18
  • 20