Several solutions to the problem that the Linux host name is changed to bogon

 

      When the Linux hostname is changed from @myhostname to @bogon , there will be problems accessing the network, and it will not be resolved after restarting. After searching on the Internet for a long time, I found the following solutions, which are hereby recorded.

 

1. Add a 127.0.0.2 host named bogon under linux.
After this method is used, the host name of bogon can be resolved, and the host name used is still bogon, but the above warning box will no longer appear when entering linux.

This method is not recommended.

 

 

2. Use the hostname command

[root@bogon ~]# hostname  xg

[root@bogon ~]# su

[root@ xg ~ ]# This is fine, but the application may still not work properly under some linux versions

This method simply retrieves the hostname you want.

 

 

3. Modify the configuration files /etc/sysconfig/network and /etc/hosts of the linux host
     1). Modify the host name in /etc/sysconfig/network.
          [root@ bogon ~ ]#   vi /etc/sysconfig/network

               NETWORKING=yes
               HOSTNAME= xg                 // Modify hostname here to xg
     2). Modify the name in /etc/hosts
          [root@ bogon ~ ]#   vi /etc/hosts
               127.0.0.1               xg
     3). No need to restart the host, and finally Execute under the terminal:
          [root@ bogon ~ ]#  hostname  xg      // xg is the modified hostname

          [root@xg ~]#

This method is the most fundamental solution

 

 

4. To make dns re-resolve,
you need to change the main dns address to save the settings at will, and then change it back to the original ip to save the settings.
Log out the current user and log in again.
It is said that when the dns server reversely resolves the private address, it will return the result bogon. Just change the dns to resolve the ip and it will be fine.

I tried it, but I personally feel that this bend is unnecessary.

 

 

 

 

 

Remark:

bogan ['bogən] ['bəugən]

bogons are addresses that should not appear in the internet routing table.
These addresses should include:
1. Private addresses such as 10, 172.16-32, 192.168.....
2. Addresses that have not been officially assigned

bogon definition:

Bogon is a bogus IP address and an informal name for an IP packet on the public Internet that claims to be from an area of the IP address spacereserved, but not yet allocated or delegated by the Internet Assigned Numbers Authority (IANA) or a delegated Regional Internet Registry (RIR). The areas of unallocated address space are called the bogon space.

For example, addresses from 49.0.0.0 – 49.255.255.255 have not yet been allocated.[1]

Bogons are not the same as reserved private address ranges, such as 10.x.x.x and 192.168.x.x.

Which are reserved for private networks.[2]

Many ISPs and end-user firewalls filter and block bogons, because they have no legitimate use, and usually are the result of accidental or malicious misconfiguration. Bogons can be filtered by using router ACLs, or by BGPblackholing.

IP addresses that are bogon today may not be bogon tomorrow. IANA and other registries frequently assign new address space to ISPs. Announcements of new assignments are often published on networkoperators’ mailing lists (such as NANOG) to ensure that operators have a chance to remove bogon filtering for addresses that have become legitimate.

IANA maintains a list of allocated and reserved IPv4 netblocks. [1]

除了上面的定义之外,还有一种定义的说法:

bogon就是Martians(就是私有地址和保留地址的称呼,详见RFC1918和RFC5735)和IANA未分配给RIR的并集。

这里有一份由IANA维护的IPV4分配列表

在这里可以看到 005/8就是未分配的地址,也就是bogon range。

同时还有一个概念叫做Fullbogons,它的定义范围比bogon还要大,指的是那些虽然IANA分配给RIR的地址,但是这些地址RIR没有分配给ISP或者end-user使用的地址。

所以来讲,bongon是没有什么用处的,需要在路由上设置ACL或者做BGP BLACKHOLING过滤掉

那么,我的主机名变成bogon是怎么回事又该怎么办呢?

可能是在反向解析IP时,DNS没有过滤bogon,所以把内网的IP反向解析成了bogon

所以把DNS换成一个过滤了bongon的DNS是其中一种解决办法

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326383568&siteId=291194637