• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
NameHero Blog

NameHero Blog

Web Hosting Tips & Resources From NameHero

  • Hosting
    • Web Hosting
    • VPS Hosting
    • WordPress Hosting
    • WooCommerce Hosting
  • Reseller
  • Enterprise
  • Domains
  • Account
  • Blog Home
  • Categories

How To Ensure Your VPS Server Emails Aren’t Marked As Spam

Bhagwad Park

Published on: November 22, 2022

Categories: VPS Hosting 0

If you’re like me, you rely on e-mails from your VPS server to inform you about important activities like backups, updates, and expiring SSL certificates. If you properly set up notifications, you minimize your time logging into your VPS and checking stuff. So it’s extremely important to ensure that these e-mails reach you on time. However, many e-mail providers like Gmail and Outlook don’t accept e-mails from IP addresses and e-mail IDs without certain DNS entries.

So this quick tutorial will help you insert the right DNS entries so that your domains can send mail without going to spam.

Accessing Your DNS Records

A good number of people use the same company for their web hosting and their domain management. If you’re one of them, you should have an interface in your web hosting admin screen for changing your DNS records. Personally, I point my nameserver to Cloudflare and manage the DNS records from there. If you use Cloudflare as well, you’ll have to log into the dashboard and make the necessary changes.

Allowing Someone to Send Mail on Your Behalf

Setting up, configuring, and maintaining an e-mail server on your own can be a harrowing task. You must deal with storage, spam, mail queues, and all kinds of hassles. As a result, many people outsource their e-mail functionality to 3rd parties like Google that handle the e-mail on their behalf instead. Earlier, I’d written about Cloudflare’s free e-mail routing that catches e-mails sent to an address and forwards them to another e-mail address of your choosing.

But this can be dangerous. After all, if a 3rd party can send e-mails on your behalf, what’s to prevent someone else from spoofing an e-mail on your behalf? And that’s why we need SPF records.

Adding an SPF Entry to Your DNS Records

An SPF DNS entry informs those who receive e-mails which parties are authorized to send e-mails on your behalf. It’s easy for anyone to spoof the “From” address on an e-mail message, but they can’t hide their IP address or the server from which the e-mail was sent. An SPF record is a compact way of informing the world which IP addresses and servers are allowed to handle e-mail on your behalf.

An SPF record has a format that looks like this:

v=spf1 ip4:xxx.xxx.xxx.xxx include:firstdomain.com include:seconddomain.com ~all

Replace xxx.xxx.xxx.xxx with the IP address of the servers you use to send your mail. Replace firstdomain.com and secondomain.com with the domains that your VPS server uses to send e-mail. If you use a 3rd party service to send e-mail, check out their documentation to find out what you should include here. It’ll be different for each provider.

For example, to use Cloudflare routing, I have to use the following address in the SPF record: _spf.mx.cloudflare.net like this:

SPF Record in DNS
SPF Record in DNS

As you can see, I’ve also included the domains that my server uses to send me notification e-mails of server events. This ensures they don’t get caught in Google’s and Outlook’s spam filters.

Mail DNS Entries Can be Confusing

My biggest problem is that I do my research on a particular issue and then forget about it afterward. Later, when I need to change something, I must re-learn it all over again! SPF and DNS records for e-mail are no different. Luckily, these don’t need to be modified once you have the correct DNS entries unless you change your e-mail provider. Hopefully, you found this article useful!

Bhagwad Park Profile Picture
Bhagwad Park

I’m a NameHero team member, and an expert on WordPress and web hosting. I’ve been in this industry since 2008. I’ve also developed apps on Android and have written extensive tutorials on managing Linux servers. You can contact me on my website WP-Tweaks.com!

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow & Subscribe

Exclusive promos, content and more!

Most Popular Posts

Speed up your site: solving the WordPress slowdown

NameHero’s Recommended WordPress Plugin and Theme Setup (2023)

How To Increase The InnoDB Buffer Pool Size

How To Fix A Stuck All-in-One WP Migration Import

How To Add A Subdomain In Cloudflare

Top Categories

  • WordPress
  • Website Performance
  • Web Hosting
  • Resellers
  • Website Development
  • Website Security
  • VPS Hosting
  • SEO Tips
  • Announcements
  • Domain Registration
NameHero

NameHero proudly provides web hosting to over 40,000 customers with 99.9% uptime to over 750,000 websites.

  • Master Card
  • Visa
  • American Express
  • Discover
  • Paypal
Products
  • Web Hosting
  • VPS Hosting
  • WordPress Hosting
  • WooCommerce Hosting
  • Reseller Hosting
  • Enterprise Hosting
  • Domains
Help & Support
  • NameHero Blog
  • Knowledgebase
  • Announcements
  • Affiliates
Company
  • About Us
  • Contact Sales
  • Reviews
  • Uptime
  • We're Hiring

Copyright © 2023 NameHero, LLC. All rights reserved.

  • Privacy Policy
  • Terms of Use
  • Acceptable Use Policy
  • Payment Policy
  • DMCA