+ -
当前位置:首页 → 问答吧 → Gentoo 的主机域名在什么地方设置?[已解决]

Gentoo 的主机域名在什么地方设置?[已解决]

时间:2007-08-12

来源:互联网

主机名在 /etc/conf.d/hostname
域名在哪?

比如 /etc/conf.d/hostname 里面
HOSTNAME="server"
DOMAINNAME="test.com"
开机时显示都是 This is server.(none) (Linux i686 2.6.21-gentoo-r4) 10:36:43,本应该是 server.test.com 的吧

作者: keelort   发布时间: 2007-08-12

在 /etc/conf.d/net 里添加一句 dns_domain_eth0="test.com" 重启就好了.

作者: diablolzl   发布时间: 2007-08-12

引用:
作者: diablolzl
在 /etc/conf.d/net 里添加一句 dns_domain_eth0="test.com" 重启就好了.
不行啊,而且这样 /etc/resolv.conf 里面的 nameserver 都被自动删除了

作者: keelort   发布时间: 2007-08-12

dns_domain_eth0="test.com"
dns_servers_eth0=" " 这里填上以前 resolv.conf 里的nameserver,用空格分隔

比如
dns_domain_eth0="test.com"
dns_servers_eth0="202.101.224.69 202.101.224.68"

重启就可以了,enjoy~

作者: diablolzl   发布时间: 2007-08-12

引用:
作者: diablolzl
dns_domain_eth0="test.com"
dns_servers_eth0=" " 这里填上以前 resolv.conf 里的nameserver,用空格分隔

比如
dns_domain_eth0="test.com"
dns_servers_eth0="202.101.224.69 202.101.224.68"

重启就可以了,enjoy~
还是不行,还是没变,这样设置的DNS也不能解析域名

作者: keelort   发布时间: 2007-08-12

你把原来的 /etc/conf.d/net 和 /etc/resolv.conf 贴上来看看

作者: diablolzl   发布时间: 2007-08-12

/etc/conf.d/net
引用:
config_eth0=( "10.5.0.222/24" )
config_eth1=( "192.168.0.1/24" )
routes_eth0=( "default gw 10.5.0.1" )
/etc/resolv.conf
引用:
domain test.com
nameserver 219.150.32.132
nameserver 202.98.0.68

作者: keelort   发布时间: 2007-08-12

在 /etc/conf.d/net 里这样写:
引用:
dns_domain="test.com"
dns_servers="219.150.32.132 202.98.0.68"

config_eth0=( "10.5.0.222/24" )
config_eth1=( "192.168.0.1/24" )
routes_eth0=( "default gw 10.5.0.1" )

作者: diablolzl   发布时间: 2007-08-12

echo "127.0.0.1 server.test.com server" >> /etc/hosts

作者: midx   发布时间: 2007-08-12

楼上正解,是还要改 /etc/hosts
按照 wiki ,完整的应该写成这样
127.0.0.1 server.test.com server localhost.localdomain localhost

作者: diablolzl   发布时间: 2007-08-12

太不幸了,按照楼上两位的方法,dns可以正常解析,可是还是显示 This is server.(none) (Linux i686 2.6.21-gentoo-r4) 10:36:43

作者: keelort   发布时间: 2007-08-12

/etc/resolv.conf
清空

/etc/conf.d/net
代码:
config_eth0=( "10.5.0.222 netmask 255.255.255.0" )
config_eth1=( "192.168.0.1 netmask 255.255.255.0" )
routes_eth0=( "default via 10.5.0.1" )
dns_servers_eth0="219.150.32.132 202.98.0.68"
/etc/hosts
代码:
127.0.0.1 localhost localhost.localdomain 
127.0.0.1 server.test.com server
# IPV6 versions of localhost and co
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

作者: midx   发布时间: 2007-08-12

引用:
作者: midx
/etc/resolv.conf
清空

/etc/conf.d/net
代码:
config_eth0=( "10.5.0.222 netmask 255.255.255.0" )
config_eth1=( "192.168.0.1 netmask 255.255.255.0" )
routes_eth0=( "default via 10.5.0.1" )
dns_servers_eth0="219.150.32.132 202.98.0.68"
/etc/hosts
代码:
127.0.0.1 localhost localhost.localdomain 
127.0.0.1 server.test.com server
# IPV6 versions of localhost and co
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
还是一样,难道和内核编译参数有关系吗?

作者: keelort   发布时间: 2007-08-12

这样啊?……据说……是RPWT

作者: midx   发布时间: 2007-08-12

引用:
作者: midx
这样啊?……据说……是RPWT
不会吧:ask,其实实在不好意思问这么简单的问题,但是实在搞不定,原来没遇到过这种问题

作者: keelort   发布时间: 2007-08-13

lz是不是要看这个?
http://linux.vbird.org/linux_server/0430nis.php

作者: zhou3345   发布时间: 2007-08-13

引用:
作者: zhou3345
lz是不是要看这个?
http://linux.vbird.org/linux_server/0430nis.php
和NIS无关吧,我这个是单个电脑

作者: keelort   发布时间: 2007-08-13

试试dns_domain和dns_server,不要加ethX看看,可能有效。

作者: superekcah   发布时间: 2007-08-13

问问搂住,
如果新装的系统,没看手册要打PP;
如果非新装系统,以前是怎么用的?

代码:
Code Listing 5: Setting the domainname

# nano -w /etc/conf.d/net

(Set the dns_domain variable to your domain name)
dns_domain_lo="homenetwork"

Note: If you choose not to set a domainname, you can get rid of the "This is hostname.(none)" messages at your login screen by editing /etc/issue. Just delete the string .\O from that file.

If you have a NIS domain (if you don't know what that is, then you don't have one), you need to define that one too:
代码:
Code Listing 13: Opening /etc/hosts

# nano -w /etc/hosts

Code Listing 14: Filling in the networking information

(This defines the current system)
127.0.0.1 tux.homenetwork tux localhost

(Define extra systems on your network,
they need to have a static IP to be defined this way.)
192.168.0.5 jenny.homenetwork jenny
192.168.0.6 benny.homenetwork benny

Save and exit the editor to continue.

作者: midx   发布时间: 2007-08-13

vim /etc/issue
把内容改成如下:
代码:
This is \n.\o (\s \m \r) \t

作者: Blahster   发布时间: 2007-08-13

补充一下,注意那个小写的o

作者: Blahster   发布时间: 2007-08-13

提起issue,昨天搞了个issue logo,挺不错 :)
上传的图像
screenshot1.png (81.1 KB, 45 次查看)

作者: midx   发布时间: 2007-08-13

haha,这个logo很酷

作者: bug732   发布时间: 2007-08-13

天,还是没用,不知道咋回事了,重装,原来装 Gentoo 没遇到过这种问题呀

作者: keelort   发布时间: 2007-08-13

引用:
作者: midx
提起issue,昨天搞了个issue logo,挺不错 :)
不错,能不能把 /etc/issue 贴出来

作者: keelort   发布时间: 2007-08-13

抄的 :P
http://gentoo-wiki.com/Talk:TIP_Login_issue

*以下一大坨是与本帖不相干的东西*
************************************************************
一个修改过的uvesafb-patch for gentoo-2.6.22-r5也放在这里。
补上该文件的原始MD5:
9749530af541a6bc4ca673a577e37169

PS. 悄悄加点,权当笔记。
uvesafb用法:
代码:
cat /sys/bus/platform/drivers/uvesafb/uvesafb.0/vbe_modes
1280x1024-32, 0x011b
1600x1200-16, 0x0146
1400x1050-16, 0x0148
2048x1536-32, 0x0152

sudo mount /boot
sudo splash_geninitramfs -v -g /boot/fbsplash-1600x1200 -r 1600x1200 livecd-2007.0
sudo splash_geninitramfs -v -g /boot/fbsplash-1400x1050 -r 1400x1050 livecd-2007.0
sudo splash_geninitramfs -v -g /boot/fbsplash-1280x1024 -r 1280x1024 livecd-2007.0

sudo nano /boot/grub/grub.conf
title=Gentoo (sda7)
root (hd0,1) # boot partition
kernel /vmlinuz root=/dev/sda7 video=uvesafb:1400x1050-16,mtrr:3,ywrap splash=s$
initrd (hd0,1)/fbsplash-1400x1050

reboot

fbset --info
另,gentoo-sources-2.6.23已经将uvesafb植入,无需这个patch了。
升级内核后如果发现fb在tty1下未起效,应该读读spock的installation instructions。
代码:
 1. cd /usr/src/linux
 2. configure the kernel; in the "Device Drivers" section select:
 Connector - unified userspace <-> kernelspace linker and
 Graphics support ---> Userspace VESA VGA graphics support
 (that's CONFIG_CONNECTOR=y and CONFIG_FB_UVESA=y)
 3. build the kernel: make
 4. remerge klibc: emerge klibc
 note: This step is necessary because klibc has to be compiled against a kernel tree that includes uvesafb. You only need to do this once, i.e. you won't have to remerge klibc every time you install a new kernel or a new kernel module.
 5. install v86d: emerge v86d
 6. reconfigure your kernel; in the "General Setup" section select:
 Initial RAM filesystem and RAM disk (initramfs/initrd) support
 and use /usr/share/v86d/initramfs in Initramfs source file(s).
 (that's CONFIG_INITRAMFS_SOURCE="/usr/share/v86d/initramfs")
 7. rebuild the kernel: make, and install it
 8. add video=uvesafb:1024x768-32,mtrr:3,ywrap (or similar) to your kernel command line
 9. reboot and enjoy uvesafb :)
上传的附件
uvesafb-0.1-rc3-gentoo-2.6.22-r5.patch.tar.gz (18.8 KB, 6 次查看)

作者: midx   发布时间: 2007-08-13

引用:
作者: midx
提起issue,昨天搞了个issue logo,挺不错 :)
赞 !

作者: zhllg   发布时间: 2007-08-13

LZ 忘了改这个文件了

$ cat /etc/conf.d/hostname
# /etc/conf.d/hostname

# Set to the hostname of this machine
HOSTNAME="xijiao.is-a-geek.org"

BTW: midx , 我真是太感谢你了

作者: 夕角   发布时间: 2007-08-13

引用:
作者: midx
提起issue,昨天搞了个issue logo,挺不错 :)
midx真是美化牛人!

作者: sheep204   发布时间: 2007-08-14

引用:
作者: midx
抄的 :P
http://gentoo-wiki.com/Talk:TIP_Login_issue

稍后有个修改过的uvesafb-patch for gentoo-2.6.22-r2也放在这里。
thx。以前用vesafb-ng在2007.0之前表现很好,可如果把theme换成2007.0就会有登录画面正常,而返回字符界面就假死的现象。打了uvesafb补丁后,使用2007.0正常了。

但还有一个问题,如果升级到splashutils-1.5,可能是因为内核还未跟上的缘故,使得console没有背景,只能暂时退回到splashutils-1.4.3。

作者: zhou3345   发布时间: 2007-08-14

重新装系统,最后解决

/etc/hosts
引用:
127.0.0.1 localhost localhost.localdomain
10.5.0.222 server.test.com test.com server
/etc/conf.d/hostname
引用:
HOSTNAME="server"
/etc/conf.d/net
引用:
dns_domain_lo="test.com"
dns_servers="219.150.32.132 202.96.64.68"

config_eth0=( "10.5.0.222/24" )
config_eth1=( "192.168.0.1/24" )
routes_eth0=( "default gw 10.5.0.1" )
/etc/resolv.conf 里面的内容如果在 /etc/conf.d/net 里面定义了,会自动被修改成 /etc/conf.d/net 里面的定义

作者: keelort   发布时间: 2007-08-16

祝贺lz。
引用:
作者: keelort
重新装系统,最后解决
lz似乎缺少midx奉陪到底的精神啊。
我现在学乖了,决不像用windows时那样,发现系统有什么不对就重装。
1.如果是系统本身的bug,重装也没用,问题依旧。(不像windows问题那么诡异)
2.如果是自己设置的问题,重装系统就全抹杀了,还是不知道自己错在哪。
3.暂时没想到,兄弟们帮忙补充吧:)

作者: zhou3345   发布时间: 2007-08-16