To hide your hostname on a LAN in Linux, you have a few options:
-
Change the hostname to a generic name:
Edit the
/etc/hostnamefile and replace your current hostname with a generic one, then reboot your system2. -
Disable hostname broadcasting:
Modify your network configuration to prevent broadcasting your hostname. This can be done by editing the
/etc/sysctl.conffile and adding:net.ipv4.conf.all.arp_ignore = 1 net.ipv4.conf.all.arp_announce = 2Then run
sudo sysctl -pto apply the changes5. -
Use a firewall to block hostname queries:
Configure your firewall (e.g., iptables or ufw) to block incoming requests for hostname information5.
-
Disable mDNS (Multicast DNS):
If you're using Avahi for mDNS, you can disable it by stopping the avahi-daemon service:
sudo systemctl stop avahi-daemon sudo systemctl disable avahi-daemon -
Modify DHCP client configuration:
Edit your DHCP client configuration file (usually
/etc/dhcp/dhclient.conf) to prevent sending the hostname to the DHCP server:send host-name "";
Keep in mind that completely hiding your hostname on a LAN can be challenging, as some network protocols rely on hostname information for proper functioning15. These methods will help reduce hostname visibility, but may not guarantee complete anonymity on the network.
- https://stackoverflow.com/questions/23533407/how-to-hide-the-hostname-on-the-terminal-on-linux
- https://askubuntu.com/questions/58849/how-to-protect-a-computer-name-from-being-disclosed-to-network-peers
- https://forums.virtualbox.org/viewtopic.php?t=66677
- https://superuser.com/questions/328690/how-to-disable-disclosing-a-computer-name-to-a-network
- https://security.stackexchange.com/questions/45689/how-to-prevent-other-hosts-on-the-same-lan-from-seeing-my-ip-and-host-name
- https://bbs.archlinux.org/viewtopic.php?id=292913
- https://forums.linuxmint.com/viewtopic.php?t=282398
- https://unix.stackexchange.com/questions/16890/how-to-make-a-machine-accessible-from-the-lan-using-its-hostname
Answer from Perplexity: https://www.perplexity.ai/search/on-linux-how-to-hide-the-hostn-Exg8ak3VT4646T9pvFz6qA?utm_source=copy_output