hosts in /etc/hosts not resolved (Full Version)

All Forums >> [Windows - UNIX Interop] >> System & Network Admin Forum



Message


gregmb -> hosts in /etc/hosts not resolved (Sep. 7, '06, 11:53:17 AM)

maybe this has been covered before but I haven't been able to find it.

Interix 3.5 on Windows XP Pro
I've install the main hotfixes for SFU


Anyway, I have added IP/hostnames to /etc/hosts however when I try to 'ping "name"' I get the
error that "name" is not found.

for example /etc/hosts

172.16.0.10 lock1


ping lock1

ping: unknow host lock1

So what I'm I doing wrong?

Thanks
Greg




eperea -> RE: hosts in /etc/hosts not resolved (Sep. 7, '06, 12:37:58 PM)

Is your /etc/hosts files still a symbolic link to the Windows hosts file? What I have is:

/etc/hosts -> /dev/fs/C/WINDOWS/system32/drivers/etc/hosts




gregmb -> RE: hosts in /etc/hosts not resolved (Sep. 7, '06, 1:10:25 PM)

yes it's still a symbolic link.

Greg




eperea -> RE: hosts in /etc/hosts not resolved (Sep. 7, '06, 1:39:15 PM)

Do you have "lookup file bind" in /etc/resolv.conf?




gregmb -> RE: hosts in /etc/hosts not resolved (Sep. 7, '06, 1:48:09 PM)

Interesting, I had 'file bind lockup'
I changed it to 'lookup file bind' with no effect, unless I neeed to reboot?

Also the complete resolv.conf has the following:
#
search
lookup file bind
nameserver 10.190.213.196




Rodney -> RE: hosts in /etc/hosts not resolved (Sep. 7, '06, 2:14:32 PM)

The search line should have the domain that your machine is part of (e.g. "bird.com").

The /etc/resolv.conf doesn't actually have an effect on ping. Try commenting
out the "nameserver" line and you'll see. (This is the ping that ships on the CD).
The hostname lookup is a system call that in turn calls WinSock for resolution.
It's really WinSock that needs to be reading the "hosts" file.




gregmb -> RE: hosts in /etc/hosts not resolved (Sep. 7, '06, 2:28:52 PM)

commenting out the nameserver had no effect.

rsh also seems to have the same problem.

The hostnames have no domain, they are on a private subnet (i.e. another NIC)
and have simple names. These nodes/hostnames are embedded controllers, no way to
alter their hostnames.

rsh & ping work when you give the IP.

So what do I need to do to get these names resolved?

I've seen this work on other XP Pro / SFU 3.5 machines.

Thanks
Greg




Rodney -> RE: hosts in /etc/hosts not resolved (Sep. 7, '06, 3:10:09 PM)

> commenting out the nameserver had no effect.

That's right. Because the ping on the CD uses the system call that uses WinSock which doesn't
know anything about /etc/resolv.conf.

> I've seen this work on other XP Pro / SFU 3.5 machines.

Yeah, it works for me as long as the "...system32/drivers/etc/hosts" file is the one that gets changed.
I don't need to reboot. So the file is regularly re-read by WinSock.
You have /etc/hosts as the symlink so that should be fine.

In the registry HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
the entry "DataBasePath": is it set to "%SystemRoot%\System32\drivers\etc" ?




gregmb -> RE: hosts in /etc/hosts not resolved (Sep. 7, '06, 3:21:43 PM)

Yes, that is what the register parameter is set to.




markfunk -> RE: hosts in /etc/hosts not resolved (Sep. 8, '06, 3:22:57 PM)

How about posting the results of the following commands:

$ /bin/uname -X
$ /bin/ls -l /etc/hosts
$ /bin/cat /etc/hosts
$ /bin/ls -l /bin/ping
$ /bin/ping lock1
$ /usr/contrib/win32/bin/wping lock1

Maybe from this we can debug it for you.




gregmb -> RE: hosts in /etc/hosts not resolved (Sep. 8, '06, 4:36:02 PM)

I was just looking at when I got your post.

I found the problem, the C:/WINDOWS/system32/drivers/etc/hosts file had odd permissions

-r-xrwx--- 1 +Administrators +SYSTEM ....... hosts

I changed it to -rwxrwxrwx , then ping and rsh started to resoled the names

Can someone list what the owner ship and permissions of these files should be.

The 'group' file appears to be owned not by Administrator but by a user account

and group, hosts, passwd , etc. also seem to vary in permissions.

So I not sure what is correct for them.


Thanks
Greg




eperea -> RE: hosts in /etc/hosts not resolved (Sep. 8, '06, 6:19:19 PM)

This is what I have:
artemis:/dev/fs/C/WINDOWS/system32/drivers/etc
{13} % l
total 14
-rwxrwx---+ 1 +Administrators  +SYSTEM        734 Sep  7 12:35 hosts*
-rwxrwx---+ 1 +Administrators  +SYSTEM       3683 Aug  4  2004 lmhosts.sam*
-rwxrwx---+ 1 +Administrators  +SYSTEM        407 Aug  4  2004 networks*
-rwxrwx---+ 1 +Administrators  +SYSTEM        799 Aug  4  2004 protocol*
-rwx------+ 1 eperea           Domain Users   205 Jul 30 12:40 resolv.conf*
-rwxrwx---+ 1 +Administrators  +SYSTEM       7116 Aug  4  2004 services*

[C:\WINDOWS\system32\drivers\etc\]cacls *
C:\WINDOWS\system32\drivers\etc\hosts BUILTIN\Users:R 
                                      BUILTIN\Power Users:R 
                                      BUILTIN\Administrators:F 
                                      NT AUTHORITY\SYSTEM:F 

C:\WINDOWS\system32\drivers\etc\lmhosts.sam BUILTIN\Users:R 
                                            BUILTIN\Power Users:R 
                                            BUILTIN\Administrators:F 
                                            NT AUTHORITY\SYSTEM:F 

C:\WINDOWS\system32\drivers\etc\networks BUILTIN\Users:R 
                                         BUILTIN\Power Users:R 
                                         BUILTIN\Administrators:F 
                                         NT AUTHORITY\SYSTEM:F 

C:\WINDOWS\system32\drivers\etc\protocol BUILTIN\Users:R 
                                         BUILTIN\Power Users:R 
                                         BUILTIN\Administrators:F 
                                         NT AUTHORITY\SYSTEM:F 

C:\WINDOWS\system32\drivers\etc\resolv.conf BUILTIN\Users:R 
                                            BUILTIN\Power Users:R 
                                            BUILTIN\Administrators:F 
                                            NT AUTHORITY\SYSTEM:F 
                                            WALKER\eperea:F 

C:\WINDOWS\system32\drivers\etc\services BUILTIN\Users:R 
                                         BUILTIN\Power Users:R 
                                         BUILTIN\Administrators:F 
                                         NT AUTHORITY\SYSTEM:F 

(the resolv.conf was added for the BIND utilities for Windows, not SFU)




Page: [1]



Forum Software © ASPPlayground.NET Advanced Edition 2.5 ANSI

0.016