Canonical: https://vpsmap.net/en/guides/dns/
Language: en
Updated: 2026-09-26T00:00:00+08:00

Networking and Data Centers

# Production-Grade DNS, IPv6 Dual-Stack Configuration, and Cloudflare CDN Integration Best Practices

VPSMap Editorial · Updated 2026-09-26 · 23 min read · [Plain-text version](https://vpsmap.net/guides/dns/index.md)

When building highly available production web services or international business infrastructure, the design of DNS, underlying network routing protocols (IPv4/IPv6 dual stack), and edge Content Delivery Networks (CDN) directly determines availability, access latency, and resilience to network risks.

Many operations staff, after purchasing **BandwagonHost（ BandwagonHost ）** CN2 GIA routes or **DMIT** Premium/Eyeball premium-routing instances, incorrect DNS cache lifecycles, crude IPv6 firewall policies, or blindly enabled CDN edge proxies often make expensive dedicated routes perform worse instead of better. Global IPv6 exposure or instances going offline after overdue payment can even cause major availability failures.

Using production-grade architectural standards, this article examines authoritative DNS management, native IPv6 dual-stack configuration on Debian/Ubuntu, disaster recovery coordination with provider control planes, and architectural trade-offs when combining Cloudflare with premium network connections.

## One. Production-Grade Authoritative DNS Architecture: Decoupling Hosting and Managing the Record Lifecycle[#](https://vpsmap.net/en/guides/dns/#section-1)

The first rule of production DNS design is to separate the **domain Registrar**and**the Authoritative DNS provider** completely decoupled.

A registrar, such as Namecheap, Dynadot, GoDaddy, or HiChina, primarily maintains the registration agreement and registration data at the top-level domain (TLD) registry. Authoritative DNS, by contrast, provides A, AAAA, and other answers to recursive resolvers worldwide with minimal latency and maximum redundancy. Delegating authoritative Nameservers to a platform with large-scale global Anycast AnyIP announcement nodes, such as Cloudflare, AWS Route 53, or NS1, enables record propagation in seconds and multiregion anycast resolution.

Command / configuration

```
访客客户端
    │
    ▼
本地递归 DNS (ISP Local DNS / 公共 DNS 如 1.1.1.1)
    │
    ▼ [递归层级查询：根域 ──> 顶级域 (.com)]
权威 Nameserver (Anycast AnyIP 广播集群，如 Cloudflare)
    │
    ├─► 返回 A 记录    ──► IPv4 实例地址 (如 BandwagonHost / DMIT)
    └─► 返回 AAAA 记录 ──► 原生 IPv6 /64 地址
```

### 1. Core Record Types and an Industrial-Grade Production Baseline[#](https://vpsmap.net/en/guides/dns/#section-2)

When configuring authoritative DNS records, go beyond basic connectivity and complete the security and anti-tampering protections:

| Record Type | Routing Target / Transport Protocol | Standard Production-Grade Configuration Pattern | Production Role and Pitfalls to Avoid |
| --- | --- | --- | --- |
| **A Record** | Map the Hostname to **IPv4 Address** | `@ / api -> 154.xx.xx.xx` | The primary channel for traditional workloads. Deployments across multiple data centers can use multiple equally weighted round-robin records or geolocation-based resolution. |
| **AAAA Record** | Map the Hostname to **IPv6 Address** | `@ / api -> 2605:xxxx::1` | Essential for Modern Networks. Ensure Full Inbound and Outbound IPv6 Connectivity to Avoid a Blackhole. |
| **CNAME Record** | Alias Mapping | `cdn -> target.edge.net` | **Note**: RFC 1034 specifies that the root domain (Zone Apex, such as `domain.com`) cannot use a CNAME record, as this would interfere with SOA/NS records. The root domain requires support for **CNAME Flattening** or **ALIAS** technology platforms. |
| **CAA Record** | Certificate Authority Authorization Restrictions | `issue "letsencrypt.org"` | **Enforced Security Baseline**. Prevents attackers from obtaining fraudulent TLS/SSL certificates for the domain through unauthorized CAs. |
| **PTR Record** | Reverse IP Resolution (rDNS) | `154.xx.xx.xx -> host.domain.com` | **Essential for Anti-Spam and API Allowlisting**. This record is not edited in your domain DNS panel; it must be configured with the server provider. |

**Practical Differences in PTR Record Management**：

- **BandwagonHost**: Edit the hostnames associated with assigned IPv4/IPv6 addresses directly in KiwiVM's “Reverse DNS (PTR)” section, with global propagation within minutes.

- **DMIT**: Some product lines provide self-service rDNS editing in the instance details within the client control panel. If this module is unavailable for a particular plan, request the mapping through a support ticket.

### 2. Graduated TTL Tuning and Planned-Change Procedures[#](https://vpsmap.net/en/guides/dns/#section-3)

TTL (Time to Live) controls cache duration at intermediate recursive DNS resolvers. In production, do not use one extremely low or high TTL throughout the entire year.

- **Normal Steady-State Period**: The recommended setting is **14400 Seconds (4 Hours) to 86400 Seconds (24 Hours)**. A high TTL greatly reduces recursive lookups from local DNS resolvers worldwide, cuts resolution handshake time, and helps prevent failures caused by occasional upstream DNS network instability.

- **Service Cutover / Cross-Data-Center Migration Plan (24~48 Hours Before the Change)**: Before a planned server IP change, such as migrating BandwagonHost data centers, changing a DMIT plan, or rebuilding a deployment,**At Least 24 Hours in Advance, Reduce the Target Record's TTL to 60–120 Seconds**.

- **Completing the Cutover and Switching Back**: After switching to the new IP and confirming traffic convergence through global probes, retain the low TTL for a 2~4-hour observation period. Once no issues remain, restore the TTL to at least 14400 seconds to regain steady-state caching benefits.

## Two. Production IPv6 Dual-Stack Configuration for BandwagonHost (KiwiVM) and DMIT[#](https://vpsmap.net/en/guides/dns/#section-4)

As IPv4 resources become scarcer and more expensive, mainstream providers, including BandwagonHost's main plans and DMIT's full cloud server lineup, include dedicated IPv4 and native IPv6 by default, typically `/64` subnet or single-IP routing). Enabling dual-stack IPv4/IPv6 networking can improve international connectivity and significantly reduce connection latency for IPv6-only users.

### 1. Console Credentials and Out-of-Band Troubleshooting Boundaries[#](https://vpsmap.net/en/guides/dns/#section-5)

Before configuring the system, understand console-level operational mechanisms to avoid losing access because of incorrect network settings:

- **BandwagonHost**：

- **Password System**: The KiwiVM control panel password is separate from the client area password and from the system's `root` passwords are isolated from one another.

- **Out-of-Band Recovery**: If network or firewall configuration causes a loss of connectivity, do not try a hard reboot; use KiwiVM's embedded **Interactive Console**, log in through out-of-band VNC to repair the network configuration files.

- **DMIT**：

- **Secure Credential Mechanisms**: During initial deployment, DMIT instances**Remote root Password Login Disabled by Default**, using secure access based on SSH Key pairs. To reset a password or replace a public key, use the instance management interface's **Access** tab to perform the operation.

- **Requirements for Changes to Take Effect**: After changing a public key or password in the DMIT panel's Access tab,**Hard-Reboot the Instance Through the Panel (Reboot)**, allowing the underlying metadata service (Cloud-Init) to inject the new credentials.

- **Emergency Recovery**: The panel's **Console** also provides out-of-band control as a last-resort recovery method when invalid Netplan syntax breaks networking or the network interface cannot start.

### 2. Persistent Linux Dual-Stack Network Configuration (Debian 12 / Ubuntu 24.04)[#](https://vpsmap.net/en/guides/dns/#section-6)

Modern Linux distributions generally use `Netplan` or native `systemd-networkd` replaces the traditional `/etc/network/interfaces`. Below is an example of a production-grade static dual-stack network definition using Netplan.

Retrieve Network Parameters from the Provider's Panel:

1. IPv4 Address, Subnet Mask, and IPv4 Default Gateway.

1. the IPv6 address assigned to you (for example, `2605:xxxx:xxxx:1::10/64`) and the provider-specified IPv6 gateway (such as `2605:xxxx:xxxx:1::1` or a link-local address `fe80::1`）。

Edit the Configuration File `/etc/netplan/01-netcfg.yaml`：

yaml

```
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: false
      dhcp6: false
      addresses:
        # 生产 IPv4 地址配置
        - 154.xx.xx.50/24
        # 生产 IPv6 双栈地址配置（/64 块内分配的静态地址）
        - 2605:xxxx:xxxx:1::10/64
      routes:
        # IPv4 默认路由
        - to: default
          via: 154.xx.xx.1
        # IPv6 默认路由
        - to: default
          via: 2605:xxxx:xxxx:1::1
          on-link: true
      nameservers:
        # 建议配置双栈权威公共解析器
        addresses:
          - 1.1.1.1
          - 8.8.8.8
          - 2606:4700:4700::1111
          - 2001:4860:4860::8888
```

**Note**: The IPv6 gateway provided by some data centers may fall outside the assigned `/64` subnet, add the following to the configuration: `on-link: true` parameter, forcing the kernel to route to the gateway directly through this interface before ARP/NDP resolution.

Test and Apply the Configuration:

bash

```
# 语法检查与试运行（若丢失网络，120秒后自动回滚）
sudo netplan try

# 确认无误后永久应用
sudo netplan apply
```

### 3. End-to-End Dual-Stack Connectivity Validation[#](https://vpsmap.net/en/guides/dns/#section-7)

Before configuring AAAA records in authoritative DNS,**You Must Thoroughly Verify IPv6 Stack Connectivity and Return Routing in the Terminal**：

bash

```
# 1. 检查物理网卡与路由表状态
ip -4 addr show dev eth0
ip -6 addr show dev eth0
ip -6 route show default

# 2. 测试双栈 ICMP 连通性
ping -c 4 1.1.1.1
ping6 -c 4 2606:4700:4700::1111

# 3. 验证出口 IP 归属与外部访问能力
curl -4 -s https://api.ipify.org
echo ""
curl -6 -s https://api64.ipify.org
echo ""
```

If `curl -6` correctly displays the static IPv6 address configured in Netplan before proceeding to bind DNS records.

### 4. Critical Defense: Securing the Boundary in an IPv6 Environment Without NAT[#](https://vpsmap.net/en/guides/dns/#section-8)

In traditional IPv4 production environments, even if internal services such as Redis, PostgreSQL, or Docker's internal container ports are mistakenly bound to `0.0.0.0`, and is usually also naturally isolated by data center NAT or external routing.

Under IPv6, however,**Every Assigned Address Is a Public Global Unicast Address**. Once the service listens on `[::]`(all IPv6 interfaces), immediately exposing that port to scanners across the global public internet.

Use `nftables` or `ufw` Establish an Explicit Default-Deny Policy:

bash

```
# 确保 UFW 启用了 IPv6 支持
sudo sed -i 's/IPV6=no/IPV6=yes/' /etc/default/ufw

# 生产级安全基线策略
sudo ufw default deny incoming
sudo ufw default allow outgoing

# 仅对外暴露生产所需的受控端口
sudo ufw allow 22/tcp comment 'SSH Management'
sudo ufw allow 80/tcp comment 'Web HTTP'
sudo ufw allow 443/tcp comment 'Web HTTPS'

# 启动防火墙
sudo ufw enable
```

## Three. Cloudflare CDN Trade-Offs: Dedicated Direct Connections Versus Anycast Proxies[#](https://vpsmap.net/en/guides/dns/#section-9)

In Cloudflare's DNS console, every record has a status toggle on the right:**Proxied (Orange Cloud)** and **DNS Only (Gray Cloud)**.

This toggle represents the most fundamental architectural choice when deploying a high-performance overseas server.

Command / configuration

```
【链路模式 1：开启代理（橙色小云朵）】
终端访客 ──> 本地网络 ──> Cloudflare 免费 Anycast 边缘节点 (美西/欧洲等) ──> [公网清洗与回源] ──> VPS 源站
  * 效果：源站 IP 被隐藏；DDoS 流量在边缘被拦截。
  * 缺陷：昂贵的 CN2 GIA / 9929 / CMIN2 高级回国路由被彻底阻断，全被绕行至普通公网。

【链路模式 2：仅 DNS（灰色小云朵）】
终端访客 ──> 本地网络 ──> 运营商核心骨干直连 (AS4809 / AS58807 / AS9929) ──> VPS 优质网络节点
  * 效果：纯正 130ms~160ms 极低延迟，晚高峰高吞吐。
  * 缺陷：源站 IP 直接暴露，遭受大流量 DDoS 攻击时依赖机房黑洞机制。
```

### 1. Comparison of Core Route Types and Performance Loss[#](https://vpsmap.net/en/guides/dns/#section-10)

A major reason users choose BandwagonHost and DMIT is their premium network routes back to China:

- **China Telecom CN2 GIA in Both Directions (AS4809)**: Such as BandwagonHost's DC6 / DC9 / Hong Kong HK data centers and DMIT's Premium (Pro) series (Los Angeles LAX Pro, Tokyo TYO Pro, and Hong Kong HKG Pro).

- **China Unicom AS9929 / China Mobile CMIN2 (AS58807)**: Such as DMIT's Eyeball (EB) series and premium hybrid networks.

This Bandwidth Costs Several Times More Than Standard International Bandwidth.**Once Cloudflare's orange cloud is enabled for these nodes, packets from visitors in China are forcibly routed to Cloudflare edge nodes, rendering all dedicated direct-route protocol announcements ineffective**. Latency jumps from 130ms to over 300ms, with severe transoceanic packet loss and connection interruptions possible during peak hours.

### 2. Production Decision Matrix: Which Cloud Icon Should You Use?[#](https://vpsmap.net/en/guides/dns/#section-11)

| Use Case / Infrastructure Type | Recommended Mode | Core Design Rationale and Architectural Trade-Offs |
| --- | --- | --- |
| **Primary Website / API on Premium Direct Routes** （BandwagonHost CN2 GIA、DMIT Pro/EB） | **DNS Only (Gray Cloud)** | **Fully Preserve the Value of Low-Latency Networking**. The service relies on direct interconnection quality, avoiding the additional hops, latency, and TCP congestion-control reinitialization introduced by CDN relays. |
| **High-Capacity Standard International Routes** (such as DMIT Tier 1 / T1 plans and standard BGP) | **Enable Proxying (Orange Cloud)** | **Positive Performance Optimization**. These data centers do not themselves offer optimized return routing to mainland China. Caching static resources at Cloudflare's edge can instead improve download speeds for end users. |
| **Layer-Four Non-HTTP Services / Operations Access** (SSH management ports, proprietary protocols, custom persistent connections) | **DNS Only (Gray Cloud)** | Cloudflare's Free Plan Proxies Only a Limited Set of Web Ports Such as 80/443; Enabling the Proxy for Layer-Four Traffic Causes Connection Resets. |
| **Emergency Failover to DDoS-Protected Infrastructure** (Blackholed After a High-Volume DDoS Attack) | **Enable for Emergencies (Temporarily Switch to Orange)** | A last-resort escape route during severe network attacks, trading higher latency for service survival. |

### 3. Dynamic Defense: Automated DDoS Circuit Breakers and Graceful Degradation[#](https://vpsmap.net/en/guides/dns/#section-12)

Typical VPS plans with premium optimized routes do not have built-in TB-scale DDoS scrubbing capacity. For example, when a node encounters tens of Gbps or more of malformed traffic, the upstream provider (such as China Telecom CTG / a US West Coast data center) will immediately apply a **Null Route (blackhole)** to protect the backbone network.

In production, you can build an automated emergency fallback mechanism using the Cloudflare API:

1. **Normal Operation**: DNS is in **Gray Cloud (DNS Only)**, with visitors accessing the system over premium direct networks for exceptional response speed.

1. **Circuit Breaker Trigger**: When an external probe from a third-party monitoring service detects more than 80% packet loss at the origin port or receives an attack notice from the data center, CI/CD or an operations script calls the Cloudflare v4 API:

bash

```
# 自动化熔断切换为 Proxied 代理
curl -X PATCH "https://api.cloudflare.com/client/v4/zones/${CF_ZONE_ID}/dns_records/${CF_RECORD_ID}" \
     -H "Authorization: Bearer ${CF_API_TOKEN}" \
     -H "Content-Type: application/json" \
     -d '{"proxied": true}'
```

1. **Scrubbing and Recovery**: Traffic is instantly switched to Cloudflare's Anycast edge network, where globally distributed scrubbing centers with hundreds of Tbps of capacity filter attacks. After the attack subsides and the origin is unblocked, switch `proxied` restore the property to `false`.

### 4. Static/Dynamic Content Separation and Hybrid Routing Across Subdomains[#](https://vpsmap.net/en/guides/dns/#section-13)

To combine fast dynamic responses over premium routes with conservation of expensive dedicated-route traffic allowances, enterprise services commonly split traffic across subdomains:

- `api.yourdomain.com`(Dynamic Transactions / Core APIs): Resolve to a BandwagonHost CN2 GIA or DMIT Pro node,**Keep the Gray Cloud (DNS Only)**. Ensures that all data exchange travels over low-latency dedicated routes.

- `assets.yourdomain.com`(Static Resources / Images / Multimedia Frontend): Configure as **Orange Cloud (Proxied)**, and enable Cloudflare Edge Cache and Tiered Cache. Global visitors receive static resources from the nearest edge cache, with only a small proportion of cache misses reaching the origin, conserving its premium-route monthly traffic allowance.

## Four. Coordinating Infrastructure Lifecycles and Production Disaster Recovery[#](https://vpsmap.net/en/guides/dns/#section-14)

Even a well-designed DNS and network architecture cannot preserve availability if operational mistakes cause the underlying server to stop or its data to be deleted. Understanding the provider's lifecycle management is an essential foundation for production stability.

### 1. Billing Cycles and Preventing Irreversible Shutdowns[#](https://vpsmap.net/en/guides/dns/#section-15)

Overseas cloud providers generally use strict automated billing and resource reclamation. Production operations must incorporate billing cycles into availability monitoring:

- **Invoice Generation and Automatic Payment Mechanisms**：

- **BandwagonHost**: a renewal invoice is generated 7 days before service expiration,**But Its Knowledge Base Explicitly States That the System Does Not Automatically Charge Credit Cards or PayPal**. If you have not prepaid enough account credit, you must log in and pay manually before expiration; otherwise, service stops immediately when due.

- **DMIT**: renewal invoices for monthly and other billing cycles are generally generated 7 days before expiration. If unpaid when due, the instance is suspended after it expires.**DMIT's Post-Suspension Retention Period Is Usually Only About 3 Days**, if payment is not made within that window, the underlying storage is destroyed and the data cannot be recovered.

- **Refund Limits and Trial-Run Constraints**：

- **BandwagonHost**: Eligible new purchases may request a refund within 30 days, but**Monthly Traffic Usage Must Be Strictly Below 10% of the Total Allowance**. Carefully plan production deployment stress tests to prevent sudden test traffic from compromising refund eligibility.

- **DMIT**: for eligible newly purchased instances, full refunds are generally limited to 3 days and**Total Usage Does Not Exceed 30GB**; a separate prorated refund mechanism based on remaining value applies within 30 days. Once the time or usage limit is exceeded, refund protection is lost.

### 2. Data Center Migration and the IP Blacklist State Machine[#](https://vpsmap.net/en/guides/dns/#section-16)

Business expansion or network policy changes often require moving data centers across regions:

- **BandwagonHost Migration Restrictions**: KiwiVM offers convenient online self-service data center migration (Migrate to another DC), allowing you to change data centers and obtain new IPv4/IPv6 addresses while retaining all your data. **Critical Prerequisite**: if the current instance's IP is blacklisted due to a violation or by an upstream network, such as when region-specific blocking is detected,**KiwiVM Directly Disables Data Center Migration**.

- **Change Management Procedures**: Before any cross-data-center migration, follow the “DNS downgrade procedure” described earlier: lower the domain TTL to 60 seconds and wait for the old records to expire completely. After confirming migration is complete, obtain the new data center IP and update DNS A/AAAA records. This prevents an irreversible global outage caused by continued resolution to the old, released IP.

## Five. Production Validation and Troubleshooting Checklist (Runbook)[#](https://vpsmap.net/en/guides/dns/#section-17)

Before switching production traffic to this architecture, perform the following checks to ensure the entire path meets the requirements:

1. **Authoritative DNS and Resolution Paths**：

- Authoritative Nameserver Delegation Is Working, with No Invalid Standard CNAME at the Zone Apex.

- CAA Records Explicitly Restrict Authorized Certificate Authorities.

- Set the domain's steady-state TTL to at least 14400 seconds, or to 60~120 seconds during a cutover.

1. **Host Networking and the IPv6 Protocol Stack**：

- The System Has Brought Up IPv4 and IPv6 Through Static Routes or Network Services.

- `curl -4` and `curl -6` can both reach external networks successfully and confirm the return-path IP.

- The Firewall (UFW/nftables) Supports IPv6, and Internal Debugging Ports and Databases Are Not Exposed on Globally Routable Unicast Addresses.

- The provider's out-of-band interactive terminal (BandwagonHost Interactive Console / DMIT Console) has been tested and is working.

1. **Cloudflare Edge Integration**：

- Confirm That Core Service Domains Using Expensive Premium Routes to China (CN2 GIA/CMIN2) Are Set To **Gray Cloud (DNS Only)**.

- Standard international routes or high-traffic static-content subdomains have correctly enabled **Orange Cloud (Proxied)**.

- An Emergency Protection Script or Manual DDoS Failover Plan Is Configured for the Origin IP.

1. **Keeping Services Active Throughout the Lifecycle**：

- Billing and Payment Alerts Are Set 7 Days Before the Due Date to Avoid Automatic Suspension.

- Back Up Data Regularly to Another Server Off-Site to Protect Against Instance Reclamation After Severe Failures.
