LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 3511|回复: 15

网络问题 mask: Host name lookup failure[solved]

[复制链接]
发表于 2008-12-25 23:08:14 | 显示全部楼层 |阅读模式
See the last post of this page by shellworld.

执行/etc/init.d/net.eth0 start 失败,提示信息如上
几个相关文件:

  1. /etc/hosts:
  2. # /etc/hosts: Local Host Database
  3. #

  4. 127.0.0.1  localhost.localdomain  localhost supertux
  5. ::1                localhost
复制代码



  1. /etc/conf.d/hostname:

  2. # /etc/conf.d/hostname

  3. # Set to the hostname of this machine
  4. HOSTNAME="supertux"

复制代码


  1. /etc/conf.d/net:
  2. # This blank configuration will automatically use DHCP for any net.*
  3. # scripts in /etc/init.d.  To create a more complete configuration,
  4. # please review /etc/conf.d/net.example and save your configuration
  5. # in /etc/conf.d/net (this file :]!).
  6. config_eth0=( "xxx.xxx.xxx.xxx mask 255.255.255.0 brd xxx.xxx.xxx255" )
  7. routes_eth0=( "default via xxx.xxx.xxx.1" )
  8. dns_servers_eth0="10.10.0.21"
  9. dns_domain_eth0="localdomain"
复制代码



文档看了好几次,照着改了好几个地方,无奈一直没解决,所以请各位帮帮忙:)
我们学校的网络是静态IP的,同时教室、图书馆提供无线网络(dhcp)。
无线网络我试过,是可以连接的;本地的网络不知哪里配置的不对,
执行/etc/init.d/net.eth0 start ,老是提示: mask: Host name lookup failure
各位大侠走过路过不要绕过呀
发表于 2008-12-25 23:50:35 | 显示全部楼层
config_eth0=( "xxx.xxx.xxx.xxx mask 255.255.255.0 brd xxx.xxx.xxx255" )
routes_eth0=( "default via xxx.xxx.xxx.1" )
dns_servers_eth0="10.10.0.21"
dns_domain_eth0="localdomain"

这里里边的xxx是什么东西?要是数字才是。你用的固定IP?如果是dhcp,用dhcpcd的方法。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-12-26 00:02:27 | 显示全部楼层
Post by blackwhite;1929827
这里里边的xxx是什么东西?要是数字才是。你用的固定IP?如果是dhcp,用dhcpcd的方法。


xxx代表我的ip
我是固定ip的,
无线网卡用dhcp是可以上网的
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-12-26 09:37:46 | 显示全部楼层
顶起
帮帮忙啊各位
回复 支持 反对

使用道具 举报

发表于 2008-12-26 10:03:34 | 显示全部楼层
试验一下下面的。
vi /etc/hosts
127.0.0.1  localhost.localdomain  localhost [color="Red"]supertux.localdomain supertux
加个红色的部分看看。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-12-26 10:06:10 | 显示全部楼层
Post by blackwhite;1929912
试验一下下面的。
vi /etc/hosts
127.0.0.1  localhost.localdomain  localhost [color="Red"]supertux.localdomain supertux
加个红色的部分看看。


谢谢,我试试看先
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-12-26 11:55:51 | 显示全部楼层
Post by blackwhite;1929912
试验一下下面的。
vi /etc/hosts
127.0.0.1  localhost.localdomain  localhost [color="Red"]supertux.localdomain supertux
加个红色的部分看看。


问题依旧,不过仍然要谢谢你
回复 支持 反对

使用道具 举报

发表于 2008-12-26 14:36:13 | 显示全部楼层
dns_servers_eth0="10.10.0.21"
dns_domain_eth0="localdomain"
不需要
回复 支持 反对

使用道具 举报

发表于 2008-12-26 17:59:51 | 显示全部楼层
Post by YaoM;1929807
执行/etc/init.d/net.eth0 start 失败,提示信息如上
几个相关文件:

  1. /etc/hosts:
  2. # /etc/hosts: Local Host Database
  3. #

  4. 127.0.0.1  localhost.localdomain  localhost supertux
  5. ::1                localhost
复制代码



  1. /etc/conf.d/hostname:

  2. # /etc/conf.d/hostname

  3. # Set to the hostname of this machine
  4. HOSTNAME="supertux"

复制代码


  1. /etc/conf.d/net:
  2. # This blank configuration will automatically use DHCP for any net.*
  3. # scripts in /etc/init.d.  To create a more complete configuration,
  4. # please review /etc/conf.d/net.example and save your configuration
  5. # in /etc/conf.d/net (this file :]!).
  6. config_eth0=( "xxx.xxx.xxx.xxx mask 255.255.255.0 brd xxx.xxx.xxx255" )
  7. routes_eth0=( "default via xxx.xxx.xxx.1" )
  8. dns_servers_eth0="10.10.0.21"
  9. dns_domain_eth0="localdomain"
复制代码



文档看了好几次,照着改了好几个地方,无奈一直没解决,所以请各位帮帮忙:)
我们学校的网络是静态IP的,同时教室、图书馆提供无线网络(dhcp)。
无线网络我试过,是可以连接的;本地的网络不知哪里配置的不对,
执行/etc/init.d/net.eth0 start ,老是提示: mask: Host name lookup failure
各位大侠走过路过不要绕过呀

-------------------------------------------------------------------------------
如果你是升级到openrc的话
onfig_eth0=( "xxx.xxx.xxx.xxx mask 255.255.255.0 brd xxx.xxx.xxx255" )
routes_eth0=( "default via xxx.xxx.xxx.1" )

改为:
config_eth0="xxx.xxx.xxx.xxx mask 255.255.255.0 brd xxx.xxx.xxx255"
routes_eth0="default via xxx.xxx.xxx.1"
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-12-26 19:03:08 | 显示全部楼层
Post by shellworld;1930137
-------------------------------------------------------------------------------
如果你是升级到openrc的话
onfig_eth0=( "xxx.xxx.xxx.xxx mask 255.255.255.0 brd xxx.xxx.xxx255" )
routes_eth0=( "default via xxx.xxx.xxx.1" )

改为:
config_eth0="xxx.xxx.xxx.xxx mask 255.255.255.0 brd xxx.xxx.xxx255"
routes_eth0="default via xxx.xxx.xxx.1"


啥叫openrc??
我ping网关是可以ping通的
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表