VPS Networking Basics: DNS, Ports, and IP Configuration Explained

Published on

Essential networking knowledge for VPS owners. Covers DNS management, port configuration, IP addresses, reverse DNS, and common networking tasks.

Written by Jochem, Infrastructure Expert, 5-10 years experience in game server hosting, VPS infrastructure, and 24/7 streaming solutions. Read author bio →

Running a VPS means managing network configuration. Here's what every VPS owner needs to know about DNS, ports, and IP addresses.

IP Addresses

IPv4 vs IPv6

FeatureIPv4IPv6
Format185.xxx.xxx.xxx2a0a:xxxx:xxxx::1
Addresses availableLimited (running out)Virtually unlimited
NAT requiredOftenNever
ConfigurationStandardGrowing adoption

Most VPS providers assign at least one IPv4 and one IPv6 address.

Check Your IPs

# IPv4
curl -4 ifconfig.me

# IPv6
curl -6 ifconfig.me

# All network interfaces
ip addr show

DNS Management

Record Types

RecordPurposeExample
APoints domain to IPv4example.com -> 185.x.x.x
AAAAPoints domain to IPv6example.com -> 2a0a::1
CNAMEAlias to another domainwww -> example.com
MXMail servermail.example.com
TXTText data (SPF, DKIM, verification)v=spf1 include:...
NSNameserverns1.provider.com
SRVService locationSpecific service endpoints

Setting Up DNS for Your VPS

  1. Buy a domain from a registrar
  2. Point the domain's A record to your VPS IP
  3. Wait for propagation (usually 5-30 minutes, up to 48 hours)
example.com      A       185.xxx.xxx.xxx
www.example.com  CNAME   example.com

Verify DNS

# Check A record
dig example.com A +short

# Check all records
dig example.com ANY

# Check propagation worldwide
dig @8.8.8.8 example.com
dig @1.1.1.1 example.com

Port Management

Common Ports

PortServiceProtocol
22SSHTCP
80HTTPTCP
443HTTPSTCP
25SMTPTCP
3306MySQLTCP
5432PostgreSQLTCP
6379RedisTCP
8080HTTP alternateTCP

Firewall Rules

# See current rules
sudo ufw status verbose

# Allow a port
sudo ufw allow 3000/tcp

# Allow from specific IP only
sudo ufw allow from 192.168.1.100 to any port 3306

# Deny a port
sudo ufw deny 8080/tcp

# Delete a rule
sudo ufw delete allow 3000/tcp

Only Expose What's Needed

ServiceShould Be Public?Firewall Rule
Web server (80, 443)YesAllow from anywhere
SSHYes (restricted)Allow from your IP or all
DatabaseNoAllow from localhost only
RedisNoAllow from localhost only
Admin panelsNoAllow from your IP only

Binding to Localhost

For services that shouldn't be public:

# MySQL - bind to localhost only
# /etc/mysql/mariadb.conf.d/50-server.cnf
bind-address = 127.0.0.1

# Redis - bind to localhost only
# /etc/redis/redis.conf
bind 127.0.0.1

Reverse DNS (rDNS)

Reverse DNS maps an IP address back to a domain name. Essential for email:

  • Without rDNS: Email servers reject your emails as potential spam
  • With rDNS: Your VPS IP resolves to your domain, improving email deliverability

Set up rDNS through your VPS provider's control panel.

HTTPS with Let's Encrypt

sudo apt install certbot
# For Nginx
sudo certbot --nginx -d example.com -d www.example.com
# For Apache
sudo certbot --apache -d example.com -d www.example.com

Certbot automatically handles renewal.

Network Performance

TestCommand
Download speedwget -O /dev/null http://speedtest.tele2.net/10MB.zip
Latencyping -c 10 google.com
Traceroutetraceroute google.com
DNS resolution speeddig google.com | grep "Query time"

Space-Node's VPS hosting connects directly to major internet exchanges with 1 Gbps connectivity. Low latency to all European networks and excellent global routing.

Jochem

About the Author

Jochem, Infrastructure Expert, expert in game server hosting, VPS infrastructure, and 24/7 streaming solutions with 5-10 years experience.

Since 2023
500+ servers hosted
4.8/5 avg rating

I specialize in Minecraft, FiveM, Rust, and 24/7 streaming infrastructure, operating enterprise-grade AMD Ryzen 9 hardware in Netherlands datacenters.

View my full bio and credentials →

Launch Your VPS Today

Get started with professional VPS hosting powered by enterprise hardware. Instant deployment and 24/7 support included.

VPS Networking Basics: DNS, Ports, and IP Configuration Explained