Skip to content

Commit 7b78d5b

Browse files
docs: add required DNS records for mongodb+srv style DNS
Signed-off-by: Arnob Kumar Saha <arnob@appscode.com>
1 parent bb4d902 commit 7b78d5b

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

  • docs/platform/guides/database-management/create-database

docs/platform/guides/database-management/create-database/mongodb.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,18 @@ Turn on **mongodb+srv style DNS** to reveal the endpoints panel:
100100

101101
The endpoints you enter must resolve to the externally reachable address of the exposed database and must be covered by the TLS certificate's SANs.
102102

103+
### DNS records you must create
104+
105+
The `mongodb+srv://` scheme is pure DNS discovery — the platform advertises the endpoints, but you must create the matching records in your DNS zone (for a replica set `rs0` on domain `example.com`):
106+
107+
| Record | Example | Why it's needed |
108+
|---|---|---|
109+
| **A** / **CNAME** — one per member | `mongo-0.example.com → <endpoint>` (repeat for each member) | Each **SRV DNS Endpoint** you entered must resolve to the member's externally reachable address. Use **A** for a fixed IP, **CNAME** to alias a managed hostname. |
110+
| **SRV** — one per member, same name | `_mongodb._tcp.example.com IN SRV 0 0 <port> mongo-0.example.com.` | This is what the driver queries first: connecting to `mongodb+srv://example.com` returns all members (host + port) so the client discovers the full replica set from one name. |
111+
| **TXT** — one, same name | `example.com IN TXT "replicaSet=rs0&authSource=admin"` | The SRV scheme requires a TXT record alongside the SRV to carry options that don't fit in SRV fields; the driver auto-appends `replicaSet`/`authSource` so the app never hardcodes them. |
112+
113+
Verify before relying on it: `dig SRV _mongodb._tcp.example.com` and `dig TXT example.com`.
114+
103115
## Additional MongoDB Options
104116

105117
| Field | Description |

0 commit comments

Comments
 (0)