Mac terminal prompt's machine name becomes "bogon" after using traceroute
I was doing some traceroute test yesterday, and today, my Mac terminal's user prompt becomes
`bogon:~ myUserName$`
Also when I'm doing traceroute like:
traceroute www.google.com
it stops with this log:
bogon (192.168.0.1) 1.158 ms 0.908 ms 0.746 ms
192.168.0.1
is the address of my wireless router.
I still can surf the internet though.
Solution 1:
By some searching I found a solution to this problem.
First, change the DNS address in your network configurations to a better one, like google's 8.8.8.8.
Second, run sudo hostname theMachineNameYouWant
in terminal.
The reason for this:
They say that when you are doing DNS lookup/reverse lookup, the DNS server can give your machine a host name, this function should be turned off for public DNS servers, but I don't know why the DNS server of my local ISP has it on.
Since my machine uses a router, so it has a IP like 192.168.0.x in LAN, I don't know why but when using traceroute, this IP will be sent to the DNS server for a reverse lookup, and since it is a reserved IP address, the DNS server returns a hostname as bogon, thus, changes my machine's hostname.
So what is bogon? Bogon means the type of IP addresses that should not appear in a traceroute, like a reserved IP address.
bogon on wikipedia.