DIGIT-ARC read-only archive · snapshot: July 23, 2026

Linux not resolving ip address from /etc/hosts file

3 posts · originally from https://geek.digit.in/community/threads/linux-not-resolving-ip-address-from-etc-hosts-file.30464/

V
valtea Original post #1
Jun 19, 2006 at 4:15 PM
Hello,

I'm maintaining a network with Linux machines as servers. I have one machine as the DNS server, one as DHCP server. I need to poing my MSSQL server "sqlserver" to a private ip (10.180.1.5) for all my clients.

Since all my clients are assigned ip address through DHCP they all are using my dns server as the DNS server. So i though instead of adding a new zone file for just one record i'll just make "sqlserver" resolve to 10.180.1.5 in my DNS server and then it will be resolved in all the machins (since they query DNS server).

My problem, starts here


[root@dns etc]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
10.180.1.5 sqlserver

[root@dns etc]# host sqlserver
Host sqlserver not found: 3(NXDOMAIN)

[root@dns etc]# cat nsswitch.conf | grep host
#hosts: db files nisplus nis dns
hosts: files dns

[root@gw etc]# cat resolv.conf
nameserver 10.180.1.11
nameserver 10.180.1.25
nameserver xxx.xxx.xx.1


Here y machine ip is 10.180.1.11, 1.25 is the dns backup server and the xxx.xxx.xx.1 is my ISP nameserver (I have just replaced it with XXX for privacy)


As posted above my problem is that the ipcannot be resolved even after it have been added in the hosts file.

Somebody please help
JGuru
JGuru #2
Jun 19, 2006 at 4:32 PM
Which Linux distro and what version of it you are using right now - both for the client
& the Server? Try autoconfiguration thro DHCP from the client also. Anyway the
procedure differs slightly from one Linux distro to the another.
V
valtea #3
Jun 20, 2006 at 11:50 AM
I'm using RHEL 3 for my servers, and most of my clients are using windows.