Recent

Author Topic: How to get Linux network name from Windows?  (Read 4838 times)

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 844
How to get Linux network name from Windows?
« on: January 15, 2019, 10:24:02 am »
I've tried to find application with such functionality, but haven't found one. Now I have Linux computers in my network and sometimes I need to remotely connect to one in order to configure it. Problem is - my network has dynamic IPs, so I don't know, what computer is what. Only way to identify them - their network names. But I also need IP addresses to connect to them. So there are problems: 1) There is no way to do it on Windows 2) Linux shows network names only - not IP addresses. What I need - to scan Linux network and list all computers available with their Linux networks names and IP addresses. I.e. something like Advanced IP Scanner, but with ability to show Linux network names. So, I just thought, that if such program doesn't exist, then I could write one for myself. Do you have any ideas, how to achieve such goal? As I understand, Linux uses NFS protocol. Is there any simple NFS libraries for Lazarus? I just need to scan network and get network name.
« Last Edit: January 15, 2019, 10:25:51 am by Mr.Madguy »
Is it healthy for project not to have regular stable releases?
Just for fun: Code::Blocks, GCC 13 and DOS - is it possible?

CCRDude

  • Hero Member
  • *****
  • Posts: 596
Re: How to get Linux network name from Windows?
« Reply #1 on: January 15, 2019, 11:02:47 am »
I'm not sure if I follow you... what do you think "Linux network names" are?

Do you refer to standard local DNS?

If you've got an IP address, you can do "nslookup 1.2.3.4" to check the corresponding network name. In FreePascal, you can use unit DNSSend from Synapse to do the same lookup. If you've got the network name, you can do "ping machine.local" and you'll see the IP address. Both directions covered on the console.

Not sure why for Linux machine administration, you would need network name and IP... usually the local DNS resolves the name to IP automatically - that's one purpose of DNS+DHCP.

Not sure where NFS comes into play here. I use NFS just with standard network names or IP addresses (not both) when I do.

If you're speaking about your own infrastructure, there are things like avahi-daemon that allow easy announcing and finding local servers. It's also great to announce ssh servers and there are ssh clients that will automatically list available machines for administration (though it's been some time I used that, avahi is mostly used in macOS environments, since it's the same as Bonjour/ZeroConf that Macs use).

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 844
Re: How to get Linux network name from Windows?
« Reply #2 on: January 15, 2019, 11:51:51 am »
I'm not sure if I follow you... what do you think "Linux network names" are?

Do you refer to standard local DNS?

If you've got an IP address, you can do "nslookup 1.2.3.4" to check the corresponding network name. In FreePascal, you can use unit DNSSend from Synapse to do the same lookup. If you've got the network name, you can do "ping machine.local" and you'll see the IP address. Both directions covered on the console.

Not sure why for Linux machine administration, you would need network name and IP... usually the local DNS resolves the name to IP automatically - that's one purpose of DNS+DHCP.

Not sure where NFS comes into play here. I use NFS just with standard network names or IP addresses (not both) when I do.

If you're speaking about your own infrastructure, there are things like avahi-daemon that allow easy announcing and finding local servers. It's also great to announce ssh servers and there are ssh clients that will automatically list available machines for administration (though it's been some time I used that, avahi is mostly used in macOS environments, since it's the same as Bonjour/ZeroConf that Macs use).
I hear about it for the second time, but this method doesn't work. What is local DNS? We have router, that provides Internet. It has DCHP, yeah. But I don't think, it's DNS will resolve local network names back to IPs. It just relays ISP's DNS server and that's it. "ping machine.local" doesn't work. "nslookup 1.2.3.4" doesn't work either. Windows Network places doesn't show any Linux computers. At the same time Linux Network places shows all Linux computes and their network names, but not IP addresses.
Is it healthy for project not to have regular stable releases?
Just for fun: Code::Blocks, GCC 13 and DOS - is it possible?

CCRDude

  • Hero Member
  • *****
  • Posts: 596
Re: How to get Linux network name from Windows?
« Reply #3 on: January 15, 2019, 12:19:17 pm »
If you've got a DHCP server, it will most likely also have a DNS server - that would route to the outside.

Check your DNS server - on Windows, using "ipconfig /all" and looking for "DNS Servers:", or on Linux, using "nslookup google.com" and check the "Server:" line (first one of output).

1. Is this a local address, or an address on the Internet?

Furthermore, "doesn't work" is an error description any developer hates :D
2. Does "doesn't work" mean it doesn't find nslookup?
3. Or that it returns an error code?
4. Or that it doesn't know 1.2.3.4 (You need to use an existing real IP address of one of your servers instead of the 1.2.3.4)?

5. Does "doesn't work" mean that ping does not return an IP address?
6. If so, which name did you supply?

7. Why don't you think that your DNS would resolve local network names? Your knowledge of I networks seems to be limited, so please don't guess :)

You could also try "hostname -a" on a Linux server to find out it's name.

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 844
Re: How to get Linux network name from Windows?
« Reply #4 on: January 15, 2019, 12:35:29 pm »
If you've got a DHCP server, it will most likely also have a DNS server - that would route to the outside.

Check your DNS server - on Windows, using "ipconfig /all" and looking for "DNS Servers:", or on Linux, using "nslookup google.com" and check the "Server:" line (first one of output).

1. Is this a local address, or an address on the Internet?

Furthermore, "doesn't work" is an error description any developer hates :D
2. Does "doesn't work" mean it doesn't find nslookup?
3. Or that it returns an error code?
4. Or that it doesn't know 1.2.3.4 (You need to use an existing real IP address of one of your servers instead of the 1.2.3.4)?

5. Does "doesn't work" mean that ping does not return an IP address?
6. If so, which name did you supply?

7. Why don't you think that your DNS would resolve local network names? Your knowledge of I networks seems to be limited, so please don't guess :)

You could also try "hostname -a" on a Linux server to find out it's name.
1. It's address of router. And it's most likely relayed to ISP's DNS.
2. "Non-existent domain".
5. "Node not found".
7. Again, because DNS is relayed to ISP's DNS. There is "DNS relay" option in any router, even home Wi-Fi routers.

My network doesn't have domain. My network uses auto configuration via DCHP. My network is simple "Use ISP's router as DCHP and DNS (relayed to ISP's DNS)". When I say "network name", I mean SMB name on Windows and (I guess) NFS name on Linux. So, what I need - to scan network the same way, Network places does it, and list all network names + IP addresses found.
Is it healthy for project not to have regular stable releases?
Just for fun: Code::Blocks, GCC 13 and DOS - is it possible?

HeavyUser

  • Sr. Member
  • ****
  • Posts: 397
Re: How to get Linux network name from Windows?
« Reply #5 on: January 15, 2019, 01:00:17 pm »
If you've got a DHCP server, it will most likely also have a DNS server - that would route to the outside.

Check your DNS server - on Windows, using "ipconfig /all" and looking for "DNS Servers:", or on Linux, using "nslookup google.com" and check the "Server:" line (first one of output).

1. Is this a local address, or an address on the Internet?

Furthermore, "doesn't work" is an error description any developer hates :D
2. Does "doesn't work" mean it doesn't find nslookup?
3. Or that it returns an error code?
4. Or that it doesn't know 1.2.3.4 (You need to use an existing real IP address of one of your servers instead of the 1.2.3.4)?

5. Does "doesn't work" mean that ping does not return an IP address?
6. If so, which name did you supply?

7. Why don't you think that your DNS would resolve local network names? Your knowledge of I networks seems to be limited, so please don't guess :)

You could also try "hostname -a" on a Linux server to find out it's name.
1. It's address of router. And it's most likely relayed to ISP's DNS.
2. "Non-existent domain".
5. "Node not found".
7. Again, because DNS is relayed to ISP's DNS. There is "DNS relay" option in any router, even home Wi-Fi routers.

My network doesn't have domain. My network uses auto configuration via DCHP. My network is simple "Use ISP's router as DCHP and DNS (relayed to ISP's DNS)". When I say "network name", I mean SMB name on Windows and (I guess) NFS name on Linux. So, what I need - to scan network the same way, Network places does it, and list all network names + IP addresses found.
install samba on linux and be done with it. Network File System (NFS) does not provide any naming support as far as I know.

CCRDude

  • Hero Member
  • *****
  • Posts: 596
Re: How to get Linux network name from Windows?
« Reply #6 on: January 15, 2019, 01:04:54 pm »
About 1 and 7: yes, of course all routers today relay to outside DNS servers. DNS is a hierarchical system. And all routers I've met in the past ten or more years do have a local domain - I can't even remember when was the last time I saw a router setup asking me to connect to an IP - they all have local network names.

Your answer to 2 is useless, since you didn't answer the question - which parameter did you reply to which tool to get that reply?

About 5.... if ping tell you "node not found" for an IP address, that sounds a lot like you didn't use an existing real server IP address. If the IP address doesn't even work with ping, how to do you except any other administration connection - any connection at all - to work with it?

I already told you how one Linux network browser I know scans the network. I'll tell you again: avahi-daemon. That's the best answer you'll get with your huge amount of untold things.

Honestly, there are dozens of Linux distributions, and multiple common desktops out there, with a bunch of different network browser tools. How do you expect anyone to tell you how you're behave if you don't give us the slightest indication on which one you're speaking about?
« Last Edit: January 15, 2019, 01:09:57 pm by CCRDude »

CCRDude

  • Hero Member
  • *****
  • Posts: 596
Re: How to get Linux network name from Windows?
« Reply #7 on: January 15, 2019, 01:08:49 pm »
install samba on linux and be done with it. Network File System (NFS) does not provide any naming support as far as I know.
He didn't specify the environment, but he spoke about configuring servers. I can only guess he actually wants to SSH, but only knows the file server list as a reference on finding servers. In that case, adding another protocol to a server just for the purpose of browsing is a no-go from the security perspective.

Again, if he can install something on those servers, using avahi/bonjour/zeroconf would be one solution, since it's a service announcement only service, not adding a whole range of new issues like adding Samba would.

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 844
Re: How to get Linux network name from Windows?
« Reply #8 on: January 15, 2019, 01:22:47 pm »
I have computers with certified operation systems. So I don't want to change their configuration. I need to connect to them via SSH and of course I need IP address. I can get IP addresses via IP scanner, but it shows IP addresses only, so I don't know what computer is where. Yeah, I can use MAC addresses for that purpose, but this solution is way too clunky. But at the same time Linux computers themselves show all Linux computers in network in their Network places. But I can't get IP addresses this way. I also don't want to connect to every computer to check, what network name it has. I have 45 of them, so it would take too long to do it.

All I need, if something like this:
(http://www.snapfiles.com/screenfiles/advportscan.png)
Problem is - only IP addresses are listed for Linux computers in this program.
Is it healthy for project not to have regular stable releases?
Just for fun: Code::Blocks, GCC 13 and DOS - is it possible?

CCRDude

  • Hero Member
  • *****
  • Posts: 596
Re: How to get Linux network name from Windows?
« Reply #9 on: January 15, 2019, 01:27:24 pm »
I love to say everything at least four times, you know, so I'm asking again: which Linux distribution & WM & browser tool does show you the names? Oh, and I forgot to mention: avahi is a tool used e.g. by Konqueror on KDE, Files on Gnome and Finder on macOS.

Did I already mention that Linux most likely uses avahi for listing them?

Wait... I've got another idea... what about avahi?

HeavyUser

  • Sr. Member
  • ****
  • Posts: 397
Re: How to get Linux network name from Windows?
« Reply #10 on: January 15, 2019, 01:34:41 pm »
install samba on linux and be done with it. Network File System (NFS) does not provide any naming support as far as I know.
He didn't specify the environment, but he spoke about configuring servers. I can only guess he actually wants to SSH, but only knows the file server list as a reference on finding servers. In that case, adding another protocol to a server just for the purpose of browsing is a no-go from the security perspective.
that rules out local dns as well.
Again, if he can install something on those servers, using avahi/bonjour/zeroconf would be one solution, since it's a service announcement only service, not adding a whole range of new issues like adding Samba would.
Yeah bonjour is a piece of shit it never worked correctly outside macos even the service on windows installed by apple software brings more network problems than smb. As for samba having problems, the implementation is problematic, like most open source projects, it is not tested adequately. As for the rest of the I have no personal experience with them bu
adding another protocol to a server just for the purpose of browsing is a no-go from the security perspective.
well you get the point. Installing samba will make things easier to setup and much windows and linux machines on the same network. Personally I would drop linux for simplicity's shake, but hey to each its own.

CCRDude

  • Hero Member
  • *****
  • Posts: 596
Re: How to get Linux network name from Windows?
« Reply #11 on: January 15, 2019, 01:52:26 pm »
Yeah bonjour is a piece of shit it never worked correctly outside macos even the service on windows installed by apple software brings more network problems than smb...

Since KDE and Gnome use it heavily as well, I think at least they believe it works quite fine. I have the same experience for 15 years now. And since even the most conservative Debian is including it in their stable branch, it seems even they regard it as stable.

Might be that the Windows version coming from Apple is not as good, but we're speaking about the open source implementation in the form of avahi-daemon here!

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 844
Re: How to get Linux network name from Windows?
« Reply #12 on: January 15, 2019, 02:28:45 pm »
I love to say everything at least four times, you know, so I'm asking again: which Linux distribution & WM & browser tool does show you the names? Oh, and I forgot to mention: avahi is a tool used e.g. by Konqueror on KDE, Files on Gnome and Finder on macOS.

Did I already mention that Linux most likely uses avahi for listing them?

Wait... I've got another idea... what about avahi?
AltLinux CPT 8.0, Mate, standard Mate Browse Network. It shows something like <Network name> (File sharing), <Network name> (ftp) and Mirror #x. None of them open or have any properties set. Just names.

Ok, may be it uses avahi. How can it help me with my problem?

My computer is Windows one, so I have two variants. 1) Boot to live distribution on my removable drive 2) Cygwin, that works well, but has very limited features.

I guess, I'll need to make MAC -> Network name database to solve this problem.
« Last Edit: January 15, 2019, 02:38:40 pm by Mr.Madguy »
Is it healthy for project not to have regular stable releases?
Just for fun: Code::Blocks, GCC 13 and DOS - is it possible?

CCRDude

  • Hero Member
  • *****
  • Posts: 596
Re: How to get Linux network name from Windows?
« Reply #13 on: January 15, 2019, 04:03:38 pm »
On Windows, you could try something like this one:
https://hobbyistsoftware.com/bonjourbrowser
Would show you if Bonjour/ZeroConf it lists the same as your Linux (not sure if it covers the full range of Avahi).

If you need it in your own code, I've found a Delphi library you could try to convert to FreePascal (it is based on Apples libraries that come with iTunes afaik):
https://github.com/deltics/delphi.libs

This forum has a few threads about mDNS as well.

Or to find out if this is the right direction, on your Linux console, try "avahi-browse -ar" and see if it lists services with names and IPs.

Mr.Madguy

  • Hero Member
  • *****
  • Posts: 844
Re: How to get Linux network name from Windows?
« Reply #14 on: January 15, 2019, 04:58:58 pm »
On Windows, you could try something like this one:
https://hobbyistsoftware.com/bonjourbrowser
Would show you if Bonjour/ZeroConf it lists the same as your Linux (not sure if it covers the full range of Avahi).

If you need it in your own code, I've found a Delphi library you could try to convert to FreePascal (it is based on Apples libraries that come with iTunes afaik):
https://github.com/deltics/delphi.libs

This forum has a few threads about mDNS as well.

Or to find out if this is the right direction, on your Linux console, try "avahi-browse -ar" and see if it lists services with names and IPs.
Ok, I'll try it.
Is it healthy for project not to have regular stable releases?
Just for fun: Code::Blocks, GCC 13 and DOS - is it possible?

 

TinyPortal © 2005-2018