I have one VPS server and 4 domains under that, having 1 IP address as of now, also I have 4 CloudFlare accounts for 4 domains hosted for easier DNS management
My question is:
Q1. Is it possible to configure server such that same IP resolves to multiple domains but sending email resolved to different domain name Example: when user with email ID abc@domain1.com sends mail to someone it should be shown as send by and signed by domain1.com, this will be same for other domains
abc@domain1.com -> send and signed by domain1.com abc@domain2.com -> send and signed by domain2.com abc@domain3.com -> send and signed by domain3.com abc@domain4.com -> send and signed by domain4.com
Though I have configured postfix settings in the main.cf file located in /etc/postfix/main.cf, but here I just managed to change the hostname for once and for all domains. I mean it is an error because whenever mail is send through different domain it is still shown as send with
domain1.com abc@domain1.com -> send and signed by domain1.com
abc@domain2.com -> send and signed by domain1.com (Note: it is signed by different domain) abc@domain3.com -> send and signed by domain1.com (Note: it is signed by different domain) abc@domain4.com -> send and signed by domain1.com (Note: it is signed by different domain) Here last 3 mail send resolves to domain1.com, which clearly is an error.
Q2. Do I have to buy new IP address for each domain I want to host at this VPS for correct resolution, does this solves Hostname problem? Is this a possible solution
How can I manage to get different Hostname for different IP. Do this have any relation to rDNS?
Q3. Is there a way to dynamically assign the hostname based on IP address/sending domain
Can someone guide me how to resolve this issue. Someone please help me.
I have edited the main.cf file located in /etc/postfix/main.cf using SSH
added the lines
myhostname = domain1.com
smtpd_banner = $myhostname ESMTP $mail_name
I have managed to successfully resolve all the DNS issues like DKIM signature, SPF record etc., but there are other 3 domains also there, but all the hostname resolves to domain1.com even though email sent using other domains.