Linux not resolving ip address from /etc/hosts file

Status
Not open for further replies.

valtea

In the zone
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

Wise Old Owl
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.
 
Status
Not open for further replies.
Top Bottom