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

NameHero® Blog

Web Hosting Tips & Resources From NameHero

  • AI Agents
    • OpenClaw
    • Claude Code
    • n8n
    • Hermes Agent
    • Open WebUI
    • Docker
  • Hosting
    • Web Hosting
    • WordPress Hosting
    • WooCommerce Hosting
    • Enterprise Hosting
    • Email Hosting
    • HeroicGuard
    • GPU Hosting
    • Website Builder
  • VPS
    • Managed VPS
    • Unmanaged VPS
    • Flex VPS
  • Reseller
  • Gaming
  • Domains
  • Account
  • Blog Home
  • Categories
  • Authors

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!

Related Posts

How to Prune Unused Images in Docker

In Docker, containers and images can build up over time, using up space and resources. Here's how to get rid of them.

How to Use Vim Search and Replace in Linux

The vim search and replace functionality in Linux consists of a series of very powerful tools - but also simple ones to get started easily.

How to Use the Bash Select Loop in Linux

The bash select loop allows your Linux script to present a set of choices to the user as a menu. Here's how to use it.

Bash Debug Mode: set -x and the PS4 Variable

When coding a program, you usually have a full IDE set up with autocomplete and stack tracing, allowing you to pause execution at any point and see what’s going on under the hood. These tools make coding more productive, and they’ve been in use for a long time. But what if you’re just quickly coding […]

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

NameHero’s Recommended WordPress Plugin and Theme Setup

WordPress Hosting vs. Web Hosting – What’s The Difference?

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
  • WordPress Tutorials
  • OpenClaw Hosting
  • Enterprise Hosting
  • WooCommerce
  • Web Hosting
  • Resellers
  • Website Security
  • Website Development
  • Website Performance
  • 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
  • Managed VPS Hosting
  • Unmanaged VPS Hosting
  • Flex VPS Hosting
  • WordPress Hosting
  • WooCommerce Hosting
  • Reseller Hosting
  • Enterprise Hosting
  • GPU Hosting
  • Email Hosting
  • HeroicGuard
  • Domains
  • Website Builder
  • AI Agent Hosting
Help & Support
  • NameHero Blog
  • NameHero Gaming Blog
  • Support
  • Help Center
  • Migrations
  • Affiliates
  • Gaming Affiliates
  • Call 1-855-984-6263
Company
  • About Us
  • Contact Sales
  • Reviews
  • Uptime
  • We're Hiring

Copyright © 2026 Name Hero, LLC. All rights reserved.
NameHero® is a registered trademark.

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