Subnetting, VLANs, DNS and DHCP Together

A client can have a perfectly valid IP address and still fail to reach a service. The switch may have placed the client in the wrong VLAN, its mask may identify the wrong on-link neighbors, DHCP may have supplied the wrong gateway, or DNS may return an address that does not match the intended service. Subnetting, VLANs, DHCP and DNS are therefore best understood as one packet journey with four different responsibilities, not four sets of isolated definitions.

To make those relationships visible, follow a small, invented network through a successful connection and several deliberate faults. This is a self-contained lab using documentation-only IPv4 address ranges; none of the addresses below should be deployed as routable production networks. The method is useful for Network+ study, but the results are observations to reason from, not a shortcut for memorizing an exam answer.

Build the addressing and switching plan before testing it

Imagine an office with user endpoints on VLAN 10 and an internal application and DNS resolver on VLAN 20. An authorized Layer 3 device routes between the two. A separate DHCP service provides configuration to endpoints through a relay on the user VLAN. The design deliberately assigns one IP subnet to each VLAN; that is an administrative convention, not a rule that a VLAN ID creates an IP subnet.

Item User VLAN 10 Service VLAN 20
Subnet 192.0.2.64/27 198.51.100.128/26
Default gateway 192.0.2.65 198.51.100.129
Example endpoint Client 192.0.2.70 App 198.51.100.130
Other service DHCP relay on gateway DNS 198.51.100.140

The /27 user subnet covers addresses 192.0.2.64 through .95, with usable host addresses from .65 through .94 in this conventional IPv4 design. The /26 service subnet runs from 198.51.100.128 through .191, with usable hosts from .129 through .190. Those boundaries matter: the client at .70/27 knows that 198.51.100.130 is not local and must send through 192.0.2.65.

All of these prefixes are reserved for examples by RFC 5737. In a real isolated lab, substitute an approved private-address plan rather than routing these documentation networks.

Trace DHCP from broadcast domain to usable configuration

A new user endpoint joins the access switch on VLAN 10. Its initial IPv4 DHCP exchange begins within that broadcast domain. Because the DHCP server is reached elsewhere, the relay on VLAN 10 forwards the relevant exchange toward the configured server. The server must associate the request with the correct client subnet and return a lease whose address, mask, gateway and resolver options match VLAN 10.

The lease should give our example client an address such as 192.0.2.70, mask 255.255.255.224, gateway 192.0.2.65 and DNS resolver 198.51.100.140. Check these values together. Seeing any address from the intended range is not enough if the client also receives a gateway from a different subnet or a stale resolver address.

If no lease arrives, first ask whether the switch port belongs to VLAN 10, whether that VLAN reaches its gateway, whether the relay is configured for the correct service, and whether an address remains available in the DHCP scope. On some IPv4 clients a self-assigned 169.254.0.0/16 address is a symptom of unsuccessful ordinary configuration, but it does not isolate the cause to the DHCP server. Comparing a working client on the same access segment is more decisive than guessing.

Prove the routing boundary before blaming DNS

With the proper lease installed, a connection to 198.51.100.130 crosses VLANs. The client sends the frame to its gateway’s Layer 2 address; the gateway routes the IP packet toward the service subnet and sends a new frame on that network. The application server must also have a usable route back to the client’s subnet. An outbound route without a working return path is not end-to-end connectivity.

Test in dependency order: check local link and VLAN association; confirm the client sees 192.0.2.65 as its gateway; inspect the neighbor/ARP entry for that gateway; check routes and authorized ACLs; then test the service’s real listening port. A failed ping can be relevant evidence, but ICMP may be filtered, so a successful or failed ping is not a complete application test.

A wrong prefix creates a particularly instructive fault. If the client uses an unnecessarily broad mask, it may treat an address that belongs beyond its gateway as on-link and attempt neighbor resolution instead of routing. If the prefix is too narrow, a genuinely local peer may be sent toward a gateway. Do not assume every mask change breaks the path: write the network boundaries down and calculate the next-hop decision before altering the lab.

Diagnose DNS after the IP path is understood

Now give the application a test name such as app.example.com and configure the lab resolver at 198.51.100.140 to answer with 198.51.100.130. The name is illustrative. The DNS server can be on a different subnet from the client because DNS queries are ordinary routed traffic once the client has a working address and reachability to its resolver.

Suppose access by IP works but the name fails. That does not prove every network component is correct, yet it narrows the investigation. Compare the configured resolver with the server actually contacted, make a direct query using nslookup or dig, inspect the returned record and any search-suffix behavior, and consider client or resolver caching. A negative response, timeout, and unexpected but syntactically valid address are different outcomes with different next steps.

If DNS returns the expected IP but the application still fails, move toward the destination service, TCP connection, TLS hostname checks and access policy. Do not declare “DNS broken” merely because the browser reports that it cannot open a named site. Conversely, replacing DNS values repeatedly will not repair a missing inter-VLAN route.

Use one controlled failure table to predict symptoms

Deliberate lab fault Likely observation First discriminating check
Move client access port to VLAN 20 Lease or expected gateway changes; client may lose normal access Compare actual switch-port VLAN and DHCP options with design
Remove VLAN 10’s DHCP relay New clients may fail to obtain a lease; existing leases may still work temporarily Compare new and already-leased clients and relay configuration
Change the user’s prefix length Incorrect on-link/next-hop decision for selected addresses Calculate both network IDs and inspect ARP/neighbor behavior
Block an inter-VLAN port with an ACL Gateway may remain reachable while the app port fails Inspect permitted flow, return path and service listener
Return an outdated DNS A record Name lookup succeeds but targets the wrong host Compare resolver answer, intended address and cache age

These are predictions to verify, not guaranteed error messages. DHCP lease timing, cached name records, host firewalls, service behavior and platform configuration can alter what a user sees. Change only one variable at a time, then restore the baseline and confirm the original path still succeeds.

Keep segmentation and service availability separate

VLANs constrain Layer 2 broadcast scope, but a routed boundary does not automatically enforce least privilege. Decide which application flows the user VLAN genuinely needs, apply policy at the appropriate routed or firewall point, and verify that DNS and DHCP dependencies remain reachable. A blocked application port can be the correct security outcome, not a network failure to work around.

Likewise, a working DNS reply does not establish that a server is healthy, and a valid DHCP lease does not prove an intended identity can authenticate. Network operators can share evidence with application or security owners without guessing the repair. For broader endpoint-to-network escalation, the network troubleshooting handoff guide follows how those ownership boundaries change as the incident expands.

Finish with an evidence-based verification record

For the clean baseline, record the port’s VLAN, client address and prefix, gateway, lease options, DNS server, expected name-to-address answer, inter-VLAN route, permitted destination port and one successful application transaction. For each induced fault, save the expected observation, actual observation, corrected element and final retest. A short table of evidence does more for practical retention than a list of isolated protocol acronyms.

Subnetting determines the host’s next-hop logic; VLANs determine the local Layer 2 neighborhood; DHCP supplies initial client configuration; DNS resolves a service name; routing and policy decide whether traffic can cross boundaries. The useful skill is following these dependencies in the right order so a symptom leads to a testable conclusion.

img