# Networking: Clients receive the wrong default gateway or DNS server — a rogue DHCP server (often a home router) answers first

**Code:** `Rogue DHCP server hands out wrong gateway/DNS` · **Category:** Networking · **Seen on:** Windows, Networking

A second DHCP server on the network is giving clients bad settings, so some machines have no internet or odd DNS.

## Meaning

Compare `ipconfig /all` and look at "DHCP Server" on a broken client. Find the rogue device (a home router plugged into the LAN via a LAN port, a VM bridge, an ICS share) and disable its DHCP, then enable DHCP snooping on switches so only trusted ports can answer.

## Common causes

- Consumer router plugged into the office LAN
- VM or hotspot bridging DHCP onto the LAN
- Internet Connection Sharing enabled
- Misconfigured second DHCP server
- No DHCP snooping on switches

## Quick fix

1. Check the DHCP server address: `ipconfig /all`
2. Unplug/disable the rogue DHCP
3. Enable DHCP snooping with trusted uplink ports only

## Detailed fix by platform

### Windows

1. 

```powershell
ipconfig /all | findstr /i "DHCP Server Default Gateway DNS"
nmap --script broadcast-dhcp-discover
```


## How to diagnose

1. **DHCP server** — Expected address?
2. **Second offer** — Present?
3. **Snooping** — Enabled?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/networking/rogue-dhcp-server-wrong-gateway)
