免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3711 | 回复: 5
打印 上一主题 下一主题

dhcp如何设置固定机器名 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-09-17 20:57 |只看该作者 |倒序浏览
我的系统为了能上网,启用了dhcp,但是我的机器从此就没有了名字,次都是unknow,即使我在hosts那些文件中设置了名字,下次还是不起作用,怎么办?如何让我的机器既能使用dhcp服务,又能使用机器名?

论坛徽章:
0
2 [报告]
发表于 2005-09-17 22:05 |只看该作者

dhcp如何设置固定机器名

在DHCP服务器上设置,在分配IP地址的时候指定主机名就可以了

论坛徽章:
0
3 [报告]
发表于 2005-09-17 22:19 |只看该作者

dhcp如何设置固定机器名

su root\r\nvi /etc/default/dhcpagent.\r\n修改为yes\r\nREQUEST_HOSTNAME=yes.(默认为no)\r\nvi /etc/hostname.hme0\r\n插入你想设置的hostname,如 \r\ninet yourname\r\n\r\n停止 dhcpagent进程,删除文件hme0.dhc(如果存在的话)\r\n# pkill dhcpagent\r\n# rm /etc/dhcp/hme0.dhc\r\n\r\nreboot

论坛徽章:
0
4 [报告]
发表于 2006-10-12 12:49 |只看该作者

回复 3楼 89728972 的帖子

为什么我按楼上说的那样改了之后还是不行?\n\n[ 本帖最后由 yyg1982 于 2006-10-12 14:12 编辑 ]

论坛徽章:
0
5 [报告]
发表于 2006-10-12 14:58 |只看该作者
我看到有的帖子里说,建立DHCP客户端,只需要创建:\r\n/etc/hostname.pcn0\r\n/etc/dhcp.pcn0\r\n\r\n这两个文件就行了,是这样吗?

论坛徽章:
0
6 [报告]
发表于 2006-10-13 00:21 |只看该作者
如果可以的话使用 sys-unconfig 重新做一下系统配置\r\n\r\nNAME\r\n     sys-unconfig - undo a system\'s configuration\r\n\r\nSYNOPSIS\r\n     /usr/sbin/sys-unconfig\r\n\r\nDESCRIPTION\r\n     The sys-unconfig command is used to restore a system\'s  con-\r\n     figuration to an \"as-manufactured\" state, ready to be recon-\r\n     figured again. The system\'s configuration consists of  host-\r\n     name,   Network   Information  Service  (NIS)  domain  name,\r\n     timezone, IP address, IP subnet  mask,  and  root  password.\r\n     This  operation  is  the  inverse  of those performed by the\r\n     sysidnet(1M), sysidns(1M), and sysidsys(1M) programs run  at\r\n     boot. See sysidtool(1M).
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP