T
T
TheSima2017-02-15 16:39:08
linux
TheSima, 2017-02-15 16:39:08

No resolve by hostname one way, from linux to linux, what could be?

Local network 192.168.0.0/24 without domain.
Actors:
- Asus router, it is also a gateway, it is also a DHCP server.
IP static 192.168.0.1
- host with WinXP
hostname Office
IP over DHCP (random)
- host with CentOS 7.2
hostname s1
IP over DHCP reserved 192.168.0.201
- host with NAS UnknownOS Linux kernel 2.6.32.12 (if it matters)
hostname ds1
IP static 192.168.0.226
Symptoms:
using the ping "hostname" command, we get the following results
s1 -> Office = OK
s1 -> ds1 = FALSE
ds1 -> Office = OK
ds1 -> s1 = OK
When pinging over IP, everything goes well.
I studied a sea of ​​literature, googled a lot of similar situations... But none of this helped me, then somewhere everything was solved by adding the problematic host to the domain. That is by adding "wins" to the hosts line in the /etc/nsswitch.conf file. or by adding "mdns4_minimal [NOTFOUND=return]" there, etc.
In this regard, I am very confused ...
I know that there is samba that has /etc/samba/smb.conf
I know that there is NSS and PAM and winbindd that connects them ... but it seems that winbindd is needed when the host in the domain, if not right, please correct me.
I understand how DNS and NetBIOS work and that they are different things and that ping "blah blah blah" is resolved in nsswitch in the order indicated there ...
In general, I studied a lot, but I could not find an answer anywhere.
What happens, for example, when host ds1 receives a bcast NetBIOS request, i.e. where is the plug?
Or this request does not come from s1, but the Office host, he somehow knows ...
Please help me figure it out, thanks to everyone in advance.
UPD : There is a suspicion that s1 is known to the DHCP server (router), he also gave him an IP, and therefore ds1 is known, because the router is (naturally) specified in the ds1 /etc/resolv.conf nameserver config.
And ds1 is not known to the DHCP server (router) because the IP of ds1 is specified by handles (static) ...
[email protected]:~# nslookup s1
Server: 192.168.0.1
Address: 192.168.0.1#53
Name: s1
Address: 192.168. 0.201
[[email protected] ~]# nslookup ds1
Server: 192.168.0.1
Address: 192.168.0.1#53
** server can't find ds1: NXDOMAIN
So I think that's the point! If you have any opinions, share them, and for now I will try to test this theory ..
At the same time, I would like to understand how easy it is to make linux work using NetBIOS names? Or maybe even simpler and better, how to tell NS on the router that ds1 is on such and such an IP. But to do it from the side of ds1. And is it possible?)
Here is one of these options I think is what I need =)
UPD 2 : I managed to get an answer on nmblookup ds1, but at the same moment nmblookup s1 does not give an answer ...
well, figs with him I thought, the main thing is that ping ds1 should work...
Well, it doesn't work. I do not know what to do.

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
T
TheSima, 2017-02-20
@TheSima

The problem was found, not at all trivial, but very trivial)
briefly like this:
nmblookup ds1 - it worked! I was almost delighted, but it was not there)
ping ds1 did not work! although ip was already known by nmblookup ds1.
was and specified the following
in /etc/nsswitch.conf in the hosts line: specified wins!
in /etc/samba/smb.conf there is a line in the [global] section
nmblookup ds1- it works! a ping ds1- no!
I didn't suffer for long.. here is the verdict
.
But, nmb smb winbind - were not started. (dot!)
It seems that samba is installed, and why shouldn’t it work ... but the fact remains, after installation ... smbclient worked great, but the daemons were not running, the host rebooted though periodically, but damn it I was completely sure that samba was installed. .. this is a lesson for me for many years) I hope everything was done not in vain, thank you all!
see comments

S
Saboteur, 2017-02-15
@saboteur_kiev

If it is a static IP, then your name is simply not written anywhere.
In Windows, wins itself collects information about local hosts (like the computer browser service), so you can call by name and it will find who it is.
In DNS - hierarchy. The host will not tell everyone who it is, it must be registered in DNS in advance
. Just register on the Office and s1 computers in /etc/hosts (system32/drivers/etc/hosts) ds1 and its IP address, and it should start responding. Well, or then you need to add this entry to your DNS server, if you use it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question