Technology πŸ‘€ KP Expert πŸ“… Sep 16, 2026 πŸ‘οΈ 229 views

Private DNS in Oracle OCI: Configuring Zones, Views, Resolvers, Listeners, and Forwarders

How OCI's five Private DNS building blocks fit together, and how to configure cross-VCN and hybrid on-premises resolution without breaking the resolution order.

5
Core Private DNS components
2
IPs consumed per forwarder endpoint
5
Setup steps covered below

Most engineers' first encounter with OCI's Private DNS service is a single private zone attached to a single VCN β€” and at that scale, it's genuinely simple. The complexity shows up the moment a second VCN, an on-premises network, or a peered environment needs to resolve names that live in OCI, or vice versa. At that point you're no longer configuring β€œDNS for a VCN” β€” you're designing a resolution topology across zones, views, resolvers, listeners, and forwarders, and getting the order of precedence wrong is the single biggest source of β€œit resolves from here but not from there” bugs.

This post walks through what each of these five components actually does, how they fit together, and how to configure cross-VCN and hybrid DNS resolution correctly.

The Five Components, and How They Relate

Before touching the console or CLI, it's worth being precise about what each term means in Oracle OCI, because they map to genuinely different objects, not synonyms for the same thing:

Component
What It Does
Private Zone
Holds actual DNS records (A, CNAME, MX), resolvable only within OCI's private DNS system
Private View
Groups related zones and controls which resolvers can see them; can attach to multiple resolvers
Resolver
Answers queries inside a VCN using attached views, then default view, then rules, then internet DNS
Listener
Endpoint that accepts inbound queries from other resolvers, on-prem networks, or peered VCNs
Forwarder
Endpoint that sends outbound queries to an external DNS server or another resolver's listener
The relationship in one line: zones hold records, views group zones and get attached to resolvers, resolvers answer queries using attached views and rules, and listeners/forwarders are the network endpoints that let resolvers talk to other resolvers outside their own VCN.
Step 1: Create the Private Zone and Add Records

Start with the zone itself:

create-zone.sh
oci dns zone create \
  --compartment-id "ocid1.compartment.oc1...." \
  --name "internal.example.com" \
  --zone-type PRIMARY \
  --scope PRIVATE \
  --view-id "ocid1.dnsview.oc1...."

Every private zone must belong to a private view β€” there's no such thing as an unscoped private zone. Add an A record for a resource inside that zone:

add-record.sh
oci dns record rrset update \
  --zone-name-or-id "internal.example.com" \
  --domain "app.internal.example.com" \
  --rtype "A" \
  --items '[{"domain":"app.internal.example.com","rtype":"A","rdata":"10.0.1.15","ttl":300}]' \
  --scope PRIVATE \
  --view-id "ocid1.dnsview.oc1...."
Step 2: Create the Private View and Attach It to a VCN's Resolver

If you didn't create the view up front, do it now:

create-view.sh
oci dns view create \
  --compartment-id "ocid1.compartment.oc1...." \
  --display-name "internal-view" \
  --scope PRIVATE

Attach the view to the VCN's default resolver so instances inside that VCN can resolve the zone:

attach-view.sh
oci dns resolver update \
  --resolver-id "ocid1.dnsresolver.oc1...." \
  --attached-views '[{"viewId":"ocid1.dnsview.oc1...."}]'
At this point, any instance inside the VCN that owns this resolver can resolve app.internal.example.com β€” but a second VCN still has no visibility into this zone at all.
Step 3: Share the View Across VCNs

There are two ways to let a second VCN resolve names from the first VCN's zone, and the choice matters for how the rest of your topology scales.

Option A β€” Attach the Same View Directly

The simplest approach for a small number of VCNs:

attach-view-vcnb.sh
oci dns resolver update \
  --resolver-id "ocid1.dnsresolver.oc1.vcnb...." \
  --attached-views '[{"viewId":"ocid1.dnsview.oc1...."}]'

This works well for a handful of VCNs but becomes unwieldy as the environment grows β€” every new VCN needs every relevant view attached, and every new view needs attaching to every VCN that should see it.

Option B β€” Deploy Listeners and Forwarders

Resolvers query each other over the network rather than sharing view attachments directly. This is the approach that scales to hub-and-spoke topologies and hybrid on-premises resolution, covered next.

Step 4: Deploy a Listener

A listener is a resolver endpoint that accepts inbound queries. Create one in a subnet of the VCN that owns the zone you want to expose:

create-listener.sh
oci dns resolver-endpoint create \
  --resolver-id "ocid1.dnsresolver.oc1...." \
  --name "lsn-vcn-a" \
  --endpoint-type VNIC \
  --is-forwarding false \
  --is-listening true \
  --subnet-id "ocid1.subnet.oc1...." \
  --listening-address "10.0.1.6"
A listening endpoint consumes one IP address from the subnet. This IP is what other resolvers will send their queries to.
Step 5: Deploy a Forwarder and a Forwarding Rule

On the other VCN β€” the one that needs to resolve names owned by the first VCN β€” deploy a forwarder:

create-forwarder.sh
oci dns resolver-endpoint create \
  --resolver-id "ocid1.dnsresolver.oc1.vcnb...." \
  --name "fwd-vcn-b" \
  --endpoint-type VNIC \
  --is-forwarding true \
  --is-listening false \
  --subnet-id "ocid1.subnet.oc1.vcnb...." \
  --forwarding-address "10.1.1.6"
A forwarding endpoint consumes two IP addresses in its subnet β€” one is used for forwarding, the second is reserved and unused. This trips people up when subnet sizing is tight.

Then add a rule on the second VCN's resolver telling it to forward queries for that specific domain to the first VCN's listener IP:

forwarding-rule.sh
oci dns resolver update \
  --resolver-id "ocid1.dnsresolver.oc1.vcnb...." \
  --rules '[
    {
      "action": "FORWARD",
      "clientAddressConditions": [],
      "qnameCoverConditions": ["internal.example.com"],
      "destinationAddresses": ["10.0.1.6"],
      "forwardingEndpointId": "ocid1.dnsresolverendpoint.oc1.vcnb...."
    }
  ]'

This rule means: any query for a name under internal.example.com gets forwarded to 10.0.1.6 β€” the listener on the other VCN β€” instead of being answered locally or sent to the internet.

The Hub Pattern: Scaling Beyond Two VCNs

For environments with more than a couple of VCNs, attaching every view to every resolver directly becomes unmanageable. The pattern that scales is designating one VCN as a DNS hub:

  • The hub VCN's resolver has every relevant private view attached β€” giving it visibility into every private zone in the region.
  • The hub VCN runs both a listener (so spoke VCNs and on-premises networks can query it) and a forwarder (so it can reach external DNS for anything it doesn't own, such as an on-premises domain).
  • Every spoke VCN runs only a forwarder, with a catch-all or domain-specific rule pointing at the hub's listener.

This collapses what would otherwise be NΓ—N view attachments into a single hub resolver holding all the views, with spokes doing a single forwarding hop. It also gives you one place to configure conditional forwarding rules for on-premises domains, rather than repeating that configuration on every VCN.

Common Pitfalls
Pitfall
Why It Matters
Wrong view or missing --scope PRIVATE
Private and public DNS objects share the same CLI commands, differentiated only by scope β€” easy to silently create a public zone by omission
Undersized forwarder subnet
A forwarding endpoint consumes two IPs, so a subnet sized for visible addresses only can run out faster than expected
Ignoring resolution order
Custom views are checked before the default view, then rules, then the internet β€” a record in the wrong view looks identical to a missing record
Missing port 53 security rules
DNS config can be entirely correct and still fail if UDP/TCP 53 is blocked between listener and forwarder
Skipping LPG/DRG connectivity
Listener and forwarder IPs are only reachable if the VCNs already have a working network path, independent of DNS
Where This Fits

Private DNS design in OCI mirrors the same hub-and-spoke thinking that governs routing and security architecture at scale: a small number of VCNs can get away with direct view attachment, but any environment expecting to grow β€” multiple business units, hybrid on-premises connectivity, or multi-VCN landing zones β€” benefits from designing the listener/forwarder/hub topology early, rather than retrofitting it once dozens of point-to-point view attachments have already accumulated.

Recap: what to take away

  • Zones hold records, views group zones and attach to resolvers, and resolvers answer using attached views, then rules, then the internet.
  • Listeners accept inbound queries; forwarders send outbound queries β€” together they let resolvers in different VCNs talk to each other.
  • Direct view attachment works for a few VCNs; listener/forwarder topologies scale better as the environment grows.
  • A hub VCN with all views attached, running both a listener and forwarder, collapses NΓ—N view sprawl into a single forwarding hop for spokes.
OCI NETWORKING SERIES Published by KP Expert β†’
Recently Enrolled

Student enrolled in this course.

View course
Explore Courses

Latest from @kp__expert

Follow on Instagram
Loading Instagram posts...

AI Course Assistant

Share your details and goals to get the best course recommendations.

Recommended Courses

Select a course name to view full details.

Course Details
Enrollment & Contact
  • Review selected course and confirm your enrollment request.
  • Click checkout to move into the full payment process.
  • After payment submission, your enrollment is processed by our team.
Admissions Contact
Email: info@kpexpert.com
Phone: +91 92708 37105
Your submitted details
Name, email and phone will appear here.
Your request has been submitted successfully. Our team will contact you shortly.