1 VPS multiple IPS

jasrrow

Registered Member
Joined
May 26, 2024
Messages
51
Reaction score
11
Hello there,

ubuntu 22.04 managed by webmin/virtualmin

i have several domains on this vps and they are sharing 1 IP.

i added second ip and changed IP for 1 domain.

when i am sending email from this domain it uses/sends email from first domain.

can someone tell me how i can use several IPs independently on the same VPS like:

domain1.com - 1.1.1.1

domain2.com - 2.2.2.2

Thanks in advance
 
Know more about CNAME records, ask your registrar for guidance

Good luck :)
 
Know more about CNAME records, ask your registrar for guidance

Good luck :)
DNS (A, CNAME) records are correctly configured and ponted on second IP.

point is in SPF i have only second IP and it says mail comes not from IP which is mentioned in SPF but first IP.
 
DNS (A, CNAME) records are correctly configured and ponted on second IP.

point is in SPF i have only second IP and it says mail comes not from IP which is mentioned in SPF but first IP.
Be sure you updated Postfix properly. In postfix you need to point ip addresses to each domain.
 
How are you sending these emails, PHP/mail-server, which one?
 
DNS (A, CNAME) records are correctly configured and ponted on second IP.

point is in SPF i have only second IP and it says mail comes not from IP which is mentioned in SPF but first IP.

Then, add both ips to SPF. If IP's belongs to the same range, then add /24

Example :
ip4:0.0.0.0/24 ( Range )
or
ip4:192.168.0.2 ip4:20.168.0.1 ( Or you can add multiple IP's to SPF )

Good Luck :)
 
Be sure you updated Postfix properly. In postfix you need to point ip addresses to each domain.
in main.cf i tried to make sender_ip_mapping configuration
and added ipmapping file in postfix : @domain2.com 2.2.2.2

anyway it sends with 1.1.1.1

mxtoolbos suggests to add 1.1.1.1 in spf records but i think it will just whitelist 1.1.1.1 ip and nothing more


How are you sending these emails, PHP/mail-server, which one?
postfix mailserver
 
Example :
ip4:0.0.0.0/24 ( Range )
or
ip4:192.168.0.2 ip4:20.168.0.1 ( Or you can add multiple IP's to SPF )
it will just whitelist 1.1.1.1 right?

it will not realy use 2.2.2.2 ip.


i mean idea is to use different IPs independently
 
An easy way to manage multiple domains on your VPS is by installing cPanel/WHM. This allows you to create separate cPanel accounts for each domain and assign dedicated IP addresses to each account.
You will be sending emails from each domain by different IPs

However, keep in mind that this approach requires upgrading to a larger cPanel license, which may involve additional costs.
 
in main.cf i tried to make sender_ip_mapping configuration
and added ipmapping file in postfix : @domain2.com 2.2.2.2

anyway it sends with 1.1.1.1

mxtoolbos suggests to add 1.1.1.1 in spf records but i think it will just whitelist 1.1.1.1 ip and nothing more



postfix mailserver

Use sender_transport and recreate the hash after you make the edits

First, edit your main.cf and add the line

Code:
sender_dependent_default_transport_maps = hash:/etc/postfix/sender_transport

This will let postfix know that the sender_transport has to be checked for routing every domain

Now create the sender_transport file and add the your domain/IP details in the below format.

Code:
domain1.com smtp:[1.1.1.1]
domain2.com smtp:[2.2.2.2]

Now rebuild the hash

Code:
postmap /etc/postfix/sender_transport

Now restart postfix and try sending a test mail.

//

This is assuming you have made the necessary edits and the second IP is configured properly in Webmin/Virtualmin
 
An easy way to manage multiple domains on your VPS is by installing cPanel/WHM. This allows you to create separate cPanel accounts for each domain and assign dedicated IP addresses to each account.
You will be sending emails from each domain by different IPs

However, keep in mind that this approach requires upgrading to a larger cPanel license, which may involve additional costs.
think he’s gonna have to worry about his emails hitting the spam folder a lot sooner than he will about the cost of anything lol.

maybe I’m wrong tho and he’s been warming up these new IPs he’s buying internally or something lol
 
Use sender_transport and recreate the hash after you make the edits

First, edit your main.cf and add the line
i did in this way and worked well.

thanks a lot for help mate :rock:


ghost666 - i am using virtualmin/webmin, dont really want to change hosting panel. thanks anyway ;)
 
Hello there,

ubuntu 22.04 managed by webmin/virtualmin

i have several domains on this vps and they are sharing 1 IP.

i added second ip and changed IP for 1 domain.

when i am sending email from this domain it uses/sends email from first domain.

can someone tell me how i can use several IPs independently on the same VPS like:

domain1.com - 1.1.1.1

domain2.com - 2.2.2.2

Thanks in advance
Did you receive the service?
 
Back
Top