大网数据广告活动
服务器运维问答

nslookup not resolving hostname

· 52CE 我爱测

I can't seem to get nslookup to resolve correctly. Here is my hosts file: [root@clc-host ge2011.11]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain …

问题原文

原帖链接 · EHQ · CC BY-SA 3.0

I can't seem to get nslookup to resolve correctly.

Here is my hosts file:

[root@clc-host ge2011.11]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.0.101   clc-host
192.168.0.101   clc-host.novalocal

Here is the results of nslookup:

[eamorr@clc-host ge2011.11]$ nslookup clc-host
Server:         10.77.254.1
Address:        10.77.254.1#53

** server can't find clc-host: NXDOMAIN

[eamorr@clc-host ge2011.11]$ nslookup clc-host.novalocal
Server:         10.77.254.1
Address:        10.77.254.1#53

** server can't find clc-host.novalocal: NXDOMAIN

Do you know how I might fix this issue? All I want to do is have "clc-host" resolve to 192.168.0.101. I need both "clc-host" and "clc-host.novalocal" to resolve to 192.168.0.101!!!

Here is " ifconfig -a"

[eamorr@clc-host ge2011.11]$ ifconfig -a
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1450
        inet 192.168.0.101  netmask 255.255.255.0  broadcast 192.168.0.255
        ether fa:16:3e:xx:xx:xx  txqueuelen 1000  (Ethernet)
        RX packets 506130  bytes 500159111 (476.9 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 318940  bytes 80431845 (76.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 0  (Local Loopback)
        RX packets 251781  bytes 57945811 (55.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 251781  bytes 57945811 (55.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:xx:xx:xx  txqueuelen 0  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0-nic: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 52:54:00:xx:xx:xx  txqueuelen 500  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

I think there is some internal problem with the DNS and I don't know how to fix it. I don't think it's related to /etc/hosts

Do I need to install a full DNS server locally?

I'm trying to install 3rd party software - the GUI won't accept an IP address and I have to use the machine's hostname, which isn't resolving...

社区高分解答

原帖链接 · Sven · CC BY-SA 3.0

nslookup (name server lookup) doesn't work with entries in the host file, instead it queries the DNS system, which doesn't know about names defined in your local hosts file. Try to just ping the name or access it in the web browser.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-06-27)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。