Forum > General

How to get Linux network name from Windows?

(1/4) > >>

Mr.Madguy:
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.

CCRDude:
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:

--- Quote from: CCRDude 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).

--- End quote ---
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.

CCRDude:
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:

--- Quote from: CCRDude 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.

--- End quote ---
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.

Navigation

[0] Message Index

[#] Next page

Go to full version