/etc/hosts主机名映射
来源:互联网 发布:tomcat绑定域名访问 编辑:程序博客网 时间:2024/05/18 17:42
小白的服务器是个双机,linux01和linux02,两者之间有信任关系,在linux101上面以root用户可以通过“ssh linux102”跳到备机上去的,但是今天,跳的不顺利,出现了如下报错:
linux101:~ # ssh linux102ssh: Could not resolve hostname linux101: Name or service not known
小白找了很多原因,无果,最后经由师傅提醒,查看了一下/etc/hosts文件:
#
# hosts This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server.
# Syntax:
#
# IP-Address Full-Qualified-Hostname Short-Hostname
#
127.0.0.1 localhost
# special IPv6 addresses
::1 localhost ipv6-localhost ipv6-loopback
fe00::0 ipv6-localnet
ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts
192.168.100.101 linux101-heart
#10.137.73.102 linux102
127.0.0.1 linux101
这里10.137.73.102 linux102被注释了,致使引用 linux102时,无法自动解析成10.137.73.102,取消注释后,重新执行命令“ssh linux102”
linux101:~ # ssh linux102Authorized users only. All activity may be monitored and reported.Last login: Wed Nov 13 10:53:39 2013 from 10.137.226.114Authorized users only. All activity may be monitored and reported.
总结: 1. /etc/hosts是IP和主机名解析的文件
2. 在/etc/hosts中一般都会有 127.0.0.1 localhost 和 127.0.0.1 linux101类似的两行,其余的视情况而定
- /etc/hosts主机名映射
- 主机名 hostname /etc/hosts
- Linux hostname主机名配置文件/etc/hosts详解
- Linux hostname主机名配置文件/etc/hosts详解
- Linux hostname主机名配置文件/etc/hosts详解
- 修改主机名(/etc/hostname和/etc/hosts区别)
- 修改主机名(/etc/hostname和/etc/hosts区别)
- linux上/etc/hosts文件域名映射
- Linux hostname主机名配置文件与文件 /etc/hosts解说
- Linux hostname主机名配置文件与文件 /etc/hosts解说
- Linux hostname主机名配置文件与文件 /etc/hosts解说
- Linux hostname主机名配置文件与文件 /etc/hosts解说
- Linux hostname主机名配置文件与文件 /etc/hosts解说
- /etc/hosts
- Linux hosts主机名不对
- /etc/hosts.allow和/etc/hosts.deny
- /etc/hosts.allow和/etc/hosts.deny
- Linux hostname主机名配置文件/etc/hosts详解 详细出处参考:http://www.jb51.net/LINUXjishu/77329.html
- 飞行(Mcool) 13.0.03106 简体中文绿色版
- javascript图片轮播特效
- Markov Random Field
- 腾讯开放平台荣获“中国互联网生态价值之星”
- MySQL InnoDB引擎影响IO性能的参数
- /etc/hosts主机名映射
- jsp
- android 定时器
- POJ 2280 Amphiphilic Carbon Molecules 极角排序 + 扫描线
- apache和Nginx上配置环境变量
- [Python下载CSDN博客]2. 使用BeautifulSoup分析HTML(二)
- WPS Office 去广告绿色版(2013.11.13更新)
- 利用软件容错技术提高Web服务组合的可靠性
- 系统日志处理系列 (一)如何使用logging、commons-logging、log4j输出日志