在 CentOS(或一般 Linux)上,“隐藏域名”通常有几种不同含义,下面按常见场景分别说明,你可以对号入座:
Nginx
server_tokens off;
避免返回 Server: nginx/1.x.x 暴露信息。
Apache
ServerTokens Prod
ServerSignature Off
编辑:
vi /etc/ssh/sshd_config
添加或修改:
DebianBanner no
或修改 hostname:
hostnamectl set-hostname localhost
重启 SSH:
systemctl restart sshd
log_format main '$remote_addr - $request';
access_log /var/log/nginx/access.log main;
/etc/hosts 中设置:192.168.1.10 hidden.local
firewall-cmd --add-rich-rule='rule family=ipv4 source address=192.168.1.0/24 port port=80 accept'
firewall-cmd --add-port=80/tcp --permanent
firewall-cmd --reload
使用:
对外只暴露代理域名。
.local / 内网 DNS如果你说的是某一个具体场景(比如:Nginx 隐藏域名、SSH 不显示主机名、DNS 不解析、浏览器地址栏隐藏),可以直接告诉我,我给你精确配置。