English | 简体中文
An LSPosed module that prevents Android NetworkStack from sending the device hostname in DHCP requests.
On some Android devices, especially Xiaomi / HyperOS devices, DHCP packets may include Option 12 Host Name, such as:
Hostname (12): "Xiaomi-15"
Vendor-Class (60): "android-dhcp-16"
This module blocks DHCP Option 12 before the packet is sent, reducing device-name leakage to routers and DHCP servers.
This module hooks Android NetworkStack and blocks DHCP Host Name option generation.
Target package:
com.android.networkstack
Known target class on tested HyperOS / Android 16 builds:
com.android.networkstack.android.net.dhcp.DhcpPacket
Hooked methods:
addTlv(ByteBuffer, byte, String)
addTlv(ByteBuffer, byte, byte[])When the DHCP option code is 12, the original method is skipped.
Android NetworkStack has a resource flag:
config_dhcp_client_hostname
On AOSP-like systems, setting this value to false may prevent DHCP hostname transmission.
However, on tested HyperOS / Android 16 builds, even when:
cmd overlay lookup com.android.networkstack com.android.networkstack:bool/config_dhcp_client_hostnamereturns:
false
DHCP packets may still contain Option 12 Hostname.
Therefore, this module blocks the final DHCP TLV writing path directly.
- Rooted Android device
- LSPosed / compatible Xposed framework
- Android NetworkStack package:
com.android.networkstack
- Tested on:
- HyperOS / Android 16
- LSPosed API 101 runtime
Other ROMs may use a different NetworkStack class name. See the compatibility notes below.
- Build or download the module APK.
- Install the APK on the device.
- Open LSPosed.
- Enable the module.
- Set the scope to:
com.android.networkstack
- Reboot the device.
- Reconnect Wi-Fi.
Use tcpdump to capture DHCP packets:
su -c "$PREFIX/bin/tcpdump -i wlan0 -n -vvv -s 0 'udp and (port 67 or port 68)'"To filter only your device, replace the MAC address:
su -c "$PREFIX/bin/tcpdump -i wlan0 -n -vvv -s 0 'ether src xx:xx:xx:xx:xx:xx and udp and (port 67 or port 68)'"Before enabling this module, you may see:
Hostname (12): "Xiaomi-15"
After enabling this module, DHCP packets should no longer contain:
Hostname (12)
Other DHCP options, such as Vendor-Class, Client-ID, Requested-IP, and Parameter-Request, are not removed by this module.
This module was successfully tested on Xiaomi 15 (dada) with HyperOS 3.0.302.0.WOCCNXM.C07 (Android 16).
This module was designed around the following class name:
com.android.networkstack.android.net.dhcp.DhcpPacket
Some ROMs may use the AOSP class name instead:
android.net.dhcp.DhcpPacket
If the module does not work on your ROM, decompile or inspect your NetworkStack.apk and search for:
DhcpPacket
addTlv
addCommonClientTlvs
Hostname
DHCP_HOST_NAME
Then adjust the hook target accordingly.
This module only blocks DHCP Option 12 Hostname.
It does not hide:
- DHCP Vendor-Class, for example
android-dhcp-16 - DHCP Client-ID
- MAC address
- mDNS / Bonjour names
- SSDP / UPnP service names
- Bluetooth device name
- Wi-Fi Direct device name
- Other LAN service discovery traffic
For stronger privacy, also consider:
- Enabling randomized MAC addresses
- Changing or clearing the Android device name
- Disabling local network discovery features when not needed
- Blocking mDNS / SSDP if those features are not required
Check LSPosed logs and confirm that the module is loaded into:
com.android.networkstack
Also verify that your ROM uses the expected class name:
com.android.networkstack.android.net.dhcp.DhcpPacket
Disable the module in LSPosed and reboot.
This module modifies DHCP packet construction. Although it only skips Option 12, unexpected ROM modifications may cause compatibility issues.
Routers may identify devices through other signals, including:
- MAC address OUI
- DHCP Vendor-Class
- mDNS
- SSDP / UPnP
- Device fingerprinting
- Previously cached records
This module only removes DHCP Hostname.
This project is intended for privacy research and personal device control.
Use it only on devices you own or administer. The author is not responsible for network issues, device instability, or misuse.
MIT License