前言windows-hosts和linux-host文件
windows位置:C:\Windows\System32\drivers\etc
linux位置:/etc/hosts
一. 将linux本地grafana端口3000映射到外网9000端口
二. 访问 http://ip:9000
成功!
二. windows-hosts文件编辑
hosts文件主要是为了做IP地址和机器名映射!
习惯了Linux下面的位置/etc/hosts,一时间还找不到Windows的对应文件在哪。
这里这里:
C:\Windows\System32\drivers\etc
然后,直接编辑HOSTS文件,在最后添加需要的IP地址和机器名,保存即可!
10.1.10.1 myhostname1
10.1.10.2 myhostname2
编辑:
访问:gegewu.com:9000
成功!
linux-hosts设置 文件位置:/etc/hosts
注:可以将常用的ip写入此文件方便记忆如github等,绕过域名解析提高访问速度。
成功!