How to get device name from scan like nmap on Linux












5














I know that I can use a tool like NMAP or arp-scan on Linux to identify the IP and MAC addresses of all devices on my local network. I also know that arp-scan will do a MAC address lookup to get the device manufacturer. But is there any set of options on these commands (or any other command) that can tell me the actual device name of the device at a give IP? For example, if "Joe's iPad" is on 192.168.1.113 I want a command to get that name.










share|improve this question






















  • Do you mean the hostname ? Or a OS Specific name that you have set ?
    – Lawrence
    Jan 16 '14 at 1:57










  • @Marc Doesn't your nmap -v -sP 192.168.1.0/24 | grep up. give you host-names? Mine for example gives Host XPS8500.fritz.box (192.168.1.33) appears to be up..
    – Rik
    Jan 16 '14 at 10:37


















5














I know that I can use a tool like NMAP or arp-scan on Linux to identify the IP and MAC addresses of all devices on my local network. I also know that arp-scan will do a MAC address lookup to get the device manufacturer. But is there any set of options on these commands (or any other command) that can tell me the actual device name of the device at a give IP? For example, if "Joe's iPad" is on 192.168.1.113 I want a command to get that name.










share|improve this question






















  • Do you mean the hostname ? Or a OS Specific name that you have set ?
    – Lawrence
    Jan 16 '14 at 1:57










  • @Marc Doesn't your nmap -v -sP 192.168.1.0/24 | grep up. give you host-names? Mine for example gives Host XPS8500.fritz.box (192.168.1.33) appears to be up..
    – Rik
    Jan 16 '14 at 10:37
















5












5








5


3





I know that I can use a tool like NMAP or arp-scan on Linux to identify the IP and MAC addresses of all devices on my local network. I also know that arp-scan will do a MAC address lookup to get the device manufacturer. But is there any set of options on these commands (or any other command) that can tell me the actual device name of the device at a give IP? For example, if "Joe's iPad" is on 192.168.1.113 I want a command to get that name.










share|improve this question













I know that I can use a tool like NMAP or arp-scan on Linux to identify the IP and MAC addresses of all devices on my local network. I also know that arp-scan will do a MAC address lookup to get the device manufacturer. But is there any set of options on these commands (or any other command) that can tell me the actual device name of the device at a give IP? For example, if "Joe's iPad" is on 192.168.1.113 I want a command to get that name.







linux networking nmap arp






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 16 '14 at 0:18









Marc

133114




133114












  • Do you mean the hostname ? Or a OS Specific name that you have set ?
    – Lawrence
    Jan 16 '14 at 1:57










  • @Marc Doesn't your nmap -v -sP 192.168.1.0/24 | grep up. give you host-names? Mine for example gives Host XPS8500.fritz.box (192.168.1.33) appears to be up..
    – Rik
    Jan 16 '14 at 10:37




















  • Do you mean the hostname ? Or a OS Specific name that you have set ?
    – Lawrence
    Jan 16 '14 at 1:57










  • @Marc Doesn't your nmap -v -sP 192.168.1.0/24 | grep up. give you host-names? Mine for example gives Host XPS8500.fritz.box (192.168.1.33) appears to be up..
    – Rik
    Jan 16 '14 at 10:37


















Do you mean the hostname ? Or a OS Specific name that you have set ?
– Lawrence
Jan 16 '14 at 1:57




Do you mean the hostname ? Or a OS Specific name that you have set ?
– Lawrence
Jan 16 '14 at 1:57












@Marc Doesn't your nmap -v -sP 192.168.1.0/24 | grep up. give you host-names? Mine for example gives Host XPS8500.fritz.box (192.168.1.33) appears to be up..
– Rik
Jan 16 '14 at 10:37






@Marc Doesn't your nmap -v -sP 192.168.1.0/24 | grep up. give you host-names? Mine for example gives Host XPS8500.fritz.box (192.168.1.33) appears to be up..
– Rik
Jan 16 '14 at 10:37












2 Answers
2






active

oldest

votes


















4














Nmap



Some hosts could simply be configured to not share that information. It should work just like this:



user@host:~$ nmap 192.168.1.113

Starting Nmap 7.00 ( https://nmap.org ) at 2015-12-11 08:45 AWST
Nmap scan report for Joes iPad (192.168.1.113)
Host is up (0.0038s latency).

Not shown: 999 closed ports
PORT STATE SERVICE
62078/tcp open iphone-sync

Nmap done: 1 IP address (1 host up) scanned in 41.88 seconds


You can force Nmap to attempt reverse DNS resolution for all targets, by using the following option:



-R (DNS resolution for all targets).

Tells Nmap to always do reverse DNS resolution on the target
IP addresses. Normally reverse DNS is only performed against
responsive (online) hosts.


This might help in some cases. The output will look more or less identical:



user@host:~$ nmap -R 192.168.1.113

Starting Nmap 7.00 ( https://nmap.org ) at 2015-12-11 08:46 AWST
Nmap scan report for joes-ipad.local (192.168.1.113)
Host is up (0.0047s latency).
rDNS record for 192.168.1.113: joes-ipad.local
Not shown: 999 closed ports
PORT STATE SERVICE
62078/tcp open iphone-sync

Nmap done: 1 IP address (1 host up) scanned in 42.61 seconds


Either way; you can always parse the output through external tools, such as grep. This can be particularly useful if you're scanning several addresses, or even whole network ranges at a time:



user@host:~$ nmap 192.168.1.0/24 | grep '(192.168.1.113)'

Nmap scan report for Joes iPad (192.168.1.113)
All 1000 scanned ports on Joes iPad (192.168.1.113) are closed


user@host:~$ nmap -R 192.168.1.0/24 | grep '(192.168.1.113)' 

Nmap scan report for Joes iPad (192.168.1.113)
All 1000 scanned ports on Joes iPad (192.168.1.133) are closed




Net-Tools



What you (probably) actually want to do, is this:
*Output will vary, based on OS & software version.



user@gnu:~$ arp 192.168.1.113

Address HWtype HWaddress Flags Mask Iface
Joes iPad ether a1:b2:c3:d4:e5:f6 C wlan0


user@bsd:~$ arp 192.168.1.113

Joes iPad (192.168.1.113) at a1:b2:c3:d4:e5:f6 on en0 ifscope [ethernet]





share|improve this answer























  • you can use arp -a ... to fore a BSD-like output.
    – DJCrashdummy
    May 5 at 15:20



















0














Take a look at nmblookup and/or smbutil lookup commands.






share|improve this answer

















  • 4




    While this might actually answer the question, it would be better if you cold expand a little and explain how these commands can be used to solve the issue at hand. In any case, as far as I know, both of these tools depend on the smb protocol and there is no reason to assume that will be used on a Linux network.
    – terdon
    Jan 16 '14 at 2:51












  • @terdon, I guess more appropriate would be to delete this answer and resubmit it as communitywiki so that anybody can edit/add to it. Let me know if that's better. Afaik Apple devices automatically register on smb.
    – Mxx
    Jan 16 '14 at 5:27








  • 3




    Why? Just add a bit more info on how these programs work, and explain that they only work on the smb protocol. Maybe add an example of how to use them as well.
    – terdon
    Jan 16 '14 at 12:37











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f702309%2fhow-to-get-device-name-from-scan-like-nmap-on-linux%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









4














Nmap



Some hosts could simply be configured to not share that information. It should work just like this:



user@host:~$ nmap 192.168.1.113

Starting Nmap 7.00 ( https://nmap.org ) at 2015-12-11 08:45 AWST
Nmap scan report for Joes iPad (192.168.1.113)
Host is up (0.0038s latency).

Not shown: 999 closed ports
PORT STATE SERVICE
62078/tcp open iphone-sync

Nmap done: 1 IP address (1 host up) scanned in 41.88 seconds


You can force Nmap to attempt reverse DNS resolution for all targets, by using the following option:



-R (DNS resolution for all targets).

Tells Nmap to always do reverse DNS resolution on the target
IP addresses. Normally reverse DNS is only performed against
responsive (online) hosts.


This might help in some cases. The output will look more or less identical:



user@host:~$ nmap -R 192.168.1.113

Starting Nmap 7.00 ( https://nmap.org ) at 2015-12-11 08:46 AWST
Nmap scan report for joes-ipad.local (192.168.1.113)
Host is up (0.0047s latency).
rDNS record for 192.168.1.113: joes-ipad.local
Not shown: 999 closed ports
PORT STATE SERVICE
62078/tcp open iphone-sync

Nmap done: 1 IP address (1 host up) scanned in 42.61 seconds


Either way; you can always parse the output through external tools, such as grep. This can be particularly useful if you're scanning several addresses, or even whole network ranges at a time:



user@host:~$ nmap 192.168.1.0/24 | grep '(192.168.1.113)'

Nmap scan report for Joes iPad (192.168.1.113)
All 1000 scanned ports on Joes iPad (192.168.1.113) are closed


user@host:~$ nmap -R 192.168.1.0/24 | grep '(192.168.1.113)' 

Nmap scan report for Joes iPad (192.168.1.113)
All 1000 scanned ports on Joes iPad (192.168.1.133) are closed




Net-Tools



What you (probably) actually want to do, is this:
*Output will vary, based on OS & software version.



user@gnu:~$ arp 192.168.1.113

Address HWtype HWaddress Flags Mask Iface
Joes iPad ether a1:b2:c3:d4:e5:f6 C wlan0


user@bsd:~$ arp 192.168.1.113

Joes iPad (192.168.1.113) at a1:b2:c3:d4:e5:f6 on en0 ifscope [ethernet]





share|improve this answer























  • you can use arp -a ... to fore a BSD-like output.
    – DJCrashdummy
    May 5 at 15:20
















4














Nmap



Some hosts could simply be configured to not share that information. It should work just like this:



user@host:~$ nmap 192.168.1.113

Starting Nmap 7.00 ( https://nmap.org ) at 2015-12-11 08:45 AWST
Nmap scan report for Joes iPad (192.168.1.113)
Host is up (0.0038s latency).

Not shown: 999 closed ports
PORT STATE SERVICE
62078/tcp open iphone-sync

Nmap done: 1 IP address (1 host up) scanned in 41.88 seconds


You can force Nmap to attempt reverse DNS resolution for all targets, by using the following option:



-R (DNS resolution for all targets).

Tells Nmap to always do reverse DNS resolution on the target
IP addresses. Normally reverse DNS is only performed against
responsive (online) hosts.


This might help in some cases. The output will look more or less identical:



user@host:~$ nmap -R 192.168.1.113

Starting Nmap 7.00 ( https://nmap.org ) at 2015-12-11 08:46 AWST
Nmap scan report for joes-ipad.local (192.168.1.113)
Host is up (0.0047s latency).
rDNS record for 192.168.1.113: joes-ipad.local
Not shown: 999 closed ports
PORT STATE SERVICE
62078/tcp open iphone-sync

Nmap done: 1 IP address (1 host up) scanned in 42.61 seconds


Either way; you can always parse the output through external tools, such as grep. This can be particularly useful if you're scanning several addresses, or even whole network ranges at a time:



user@host:~$ nmap 192.168.1.0/24 | grep '(192.168.1.113)'

Nmap scan report for Joes iPad (192.168.1.113)
All 1000 scanned ports on Joes iPad (192.168.1.113) are closed


user@host:~$ nmap -R 192.168.1.0/24 | grep '(192.168.1.113)' 

Nmap scan report for Joes iPad (192.168.1.113)
All 1000 scanned ports on Joes iPad (192.168.1.133) are closed




Net-Tools



What you (probably) actually want to do, is this:
*Output will vary, based on OS & software version.



user@gnu:~$ arp 192.168.1.113

Address HWtype HWaddress Flags Mask Iface
Joes iPad ether a1:b2:c3:d4:e5:f6 C wlan0


user@bsd:~$ arp 192.168.1.113

Joes iPad (192.168.1.113) at a1:b2:c3:d4:e5:f6 on en0 ifscope [ethernet]





share|improve this answer























  • you can use arp -a ... to fore a BSD-like output.
    – DJCrashdummy
    May 5 at 15:20














4












4








4






Nmap



Some hosts could simply be configured to not share that information. It should work just like this:



user@host:~$ nmap 192.168.1.113

Starting Nmap 7.00 ( https://nmap.org ) at 2015-12-11 08:45 AWST
Nmap scan report for Joes iPad (192.168.1.113)
Host is up (0.0038s latency).

Not shown: 999 closed ports
PORT STATE SERVICE
62078/tcp open iphone-sync

Nmap done: 1 IP address (1 host up) scanned in 41.88 seconds


You can force Nmap to attempt reverse DNS resolution for all targets, by using the following option:



-R (DNS resolution for all targets).

Tells Nmap to always do reverse DNS resolution on the target
IP addresses. Normally reverse DNS is only performed against
responsive (online) hosts.


This might help in some cases. The output will look more or less identical:



user@host:~$ nmap -R 192.168.1.113

Starting Nmap 7.00 ( https://nmap.org ) at 2015-12-11 08:46 AWST
Nmap scan report for joes-ipad.local (192.168.1.113)
Host is up (0.0047s latency).
rDNS record for 192.168.1.113: joes-ipad.local
Not shown: 999 closed ports
PORT STATE SERVICE
62078/tcp open iphone-sync

Nmap done: 1 IP address (1 host up) scanned in 42.61 seconds


Either way; you can always parse the output through external tools, such as grep. This can be particularly useful if you're scanning several addresses, or even whole network ranges at a time:



user@host:~$ nmap 192.168.1.0/24 | grep '(192.168.1.113)'

Nmap scan report for Joes iPad (192.168.1.113)
All 1000 scanned ports on Joes iPad (192.168.1.113) are closed


user@host:~$ nmap -R 192.168.1.0/24 | grep '(192.168.1.113)' 

Nmap scan report for Joes iPad (192.168.1.113)
All 1000 scanned ports on Joes iPad (192.168.1.133) are closed




Net-Tools



What you (probably) actually want to do, is this:
*Output will vary, based on OS & software version.



user@gnu:~$ arp 192.168.1.113

Address HWtype HWaddress Flags Mask Iface
Joes iPad ether a1:b2:c3:d4:e5:f6 C wlan0


user@bsd:~$ arp 192.168.1.113

Joes iPad (192.168.1.113) at a1:b2:c3:d4:e5:f6 on en0 ifscope [ethernet]





share|improve this answer














Nmap



Some hosts could simply be configured to not share that information. It should work just like this:



user@host:~$ nmap 192.168.1.113

Starting Nmap 7.00 ( https://nmap.org ) at 2015-12-11 08:45 AWST
Nmap scan report for Joes iPad (192.168.1.113)
Host is up (0.0038s latency).

Not shown: 999 closed ports
PORT STATE SERVICE
62078/tcp open iphone-sync

Nmap done: 1 IP address (1 host up) scanned in 41.88 seconds


You can force Nmap to attempt reverse DNS resolution for all targets, by using the following option:



-R (DNS resolution for all targets).

Tells Nmap to always do reverse DNS resolution on the target
IP addresses. Normally reverse DNS is only performed against
responsive (online) hosts.


This might help in some cases. The output will look more or less identical:



user@host:~$ nmap -R 192.168.1.113

Starting Nmap 7.00 ( https://nmap.org ) at 2015-12-11 08:46 AWST
Nmap scan report for joes-ipad.local (192.168.1.113)
Host is up (0.0047s latency).
rDNS record for 192.168.1.113: joes-ipad.local
Not shown: 999 closed ports
PORT STATE SERVICE
62078/tcp open iphone-sync

Nmap done: 1 IP address (1 host up) scanned in 42.61 seconds


Either way; you can always parse the output through external tools, such as grep. This can be particularly useful if you're scanning several addresses, or even whole network ranges at a time:



user@host:~$ nmap 192.168.1.0/24 | grep '(192.168.1.113)'

Nmap scan report for Joes iPad (192.168.1.113)
All 1000 scanned ports on Joes iPad (192.168.1.113) are closed


user@host:~$ nmap -R 192.168.1.0/24 | grep '(192.168.1.113)' 

Nmap scan report for Joes iPad (192.168.1.113)
All 1000 scanned ports on Joes iPad (192.168.1.133) are closed




Net-Tools



What you (probably) actually want to do, is this:
*Output will vary, based on OS & software version.



user@gnu:~$ arp 192.168.1.113

Address HWtype HWaddress Flags Mask Iface
Joes iPad ether a1:b2:c3:d4:e5:f6 C wlan0


user@bsd:~$ arp 192.168.1.113

Joes iPad (192.168.1.113) at a1:b2:c3:d4:e5:f6 on en0 ifscope [ethernet]






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 22 at 18:53

























answered Dec 11 '15 at 5:34









tjt263

1,31121333




1,31121333












  • you can use arp -a ... to fore a BSD-like output.
    – DJCrashdummy
    May 5 at 15:20


















  • you can use arp -a ... to fore a BSD-like output.
    – DJCrashdummy
    May 5 at 15:20
















you can use arp -a ... to fore a BSD-like output.
– DJCrashdummy
May 5 at 15:20




you can use arp -a ... to fore a BSD-like output.
– DJCrashdummy
May 5 at 15:20













0














Take a look at nmblookup and/or smbutil lookup commands.






share|improve this answer

















  • 4




    While this might actually answer the question, it would be better if you cold expand a little and explain how these commands can be used to solve the issue at hand. In any case, as far as I know, both of these tools depend on the smb protocol and there is no reason to assume that will be used on a Linux network.
    – terdon
    Jan 16 '14 at 2:51












  • @terdon, I guess more appropriate would be to delete this answer and resubmit it as communitywiki so that anybody can edit/add to it. Let me know if that's better. Afaik Apple devices automatically register on smb.
    – Mxx
    Jan 16 '14 at 5:27








  • 3




    Why? Just add a bit more info on how these programs work, and explain that they only work on the smb protocol. Maybe add an example of how to use them as well.
    – terdon
    Jan 16 '14 at 12:37
















0














Take a look at nmblookup and/or smbutil lookup commands.






share|improve this answer

















  • 4




    While this might actually answer the question, it would be better if you cold expand a little and explain how these commands can be used to solve the issue at hand. In any case, as far as I know, both of these tools depend on the smb protocol and there is no reason to assume that will be used on a Linux network.
    – terdon
    Jan 16 '14 at 2:51












  • @terdon, I guess more appropriate would be to delete this answer and resubmit it as communitywiki so that anybody can edit/add to it. Let me know if that's better. Afaik Apple devices automatically register on smb.
    – Mxx
    Jan 16 '14 at 5:27








  • 3




    Why? Just add a bit more info on how these programs work, and explain that they only work on the smb protocol. Maybe add an example of how to use them as well.
    – terdon
    Jan 16 '14 at 12:37














0












0








0






Take a look at nmblookup and/or smbutil lookup commands.






share|improve this answer












Take a look at nmblookup and/or smbutil lookup commands.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 16 '14 at 1:12









Mxx

2,53821534




2,53821534








  • 4




    While this might actually answer the question, it would be better if you cold expand a little and explain how these commands can be used to solve the issue at hand. In any case, as far as I know, both of these tools depend on the smb protocol and there is no reason to assume that will be used on a Linux network.
    – terdon
    Jan 16 '14 at 2:51












  • @terdon, I guess more appropriate would be to delete this answer and resubmit it as communitywiki so that anybody can edit/add to it. Let me know if that's better. Afaik Apple devices automatically register on smb.
    – Mxx
    Jan 16 '14 at 5:27








  • 3




    Why? Just add a bit more info on how these programs work, and explain that they only work on the smb protocol. Maybe add an example of how to use them as well.
    – terdon
    Jan 16 '14 at 12:37














  • 4




    While this might actually answer the question, it would be better if you cold expand a little and explain how these commands can be used to solve the issue at hand. In any case, as far as I know, both of these tools depend on the smb protocol and there is no reason to assume that will be used on a Linux network.
    – terdon
    Jan 16 '14 at 2:51












  • @terdon, I guess more appropriate would be to delete this answer and resubmit it as communitywiki so that anybody can edit/add to it. Let me know if that's better. Afaik Apple devices automatically register on smb.
    – Mxx
    Jan 16 '14 at 5:27








  • 3




    Why? Just add a bit more info on how these programs work, and explain that they only work on the smb protocol. Maybe add an example of how to use them as well.
    – terdon
    Jan 16 '14 at 12:37








4




4




While this might actually answer the question, it would be better if you cold expand a little and explain how these commands can be used to solve the issue at hand. In any case, as far as I know, both of these tools depend on the smb protocol and there is no reason to assume that will be used on a Linux network.
– terdon
Jan 16 '14 at 2:51






While this might actually answer the question, it would be better if you cold expand a little and explain how these commands can be used to solve the issue at hand. In any case, as far as I know, both of these tools depend on the smb protocol and there is no reason to assume that will be used on a Linux network.
– terdon
Jan 16 '14 at 2:51














@terdon, I guess more appropriate would be to delete this answer and resubmit it as communitywiki so that anybody can edit/add to it. Let me know if that's better. Afaik Apple devices automatically register on smb.
– Mxx
Jan 16 '14 at 5:27






@terdon, I guess more appropriate would be to delete this answer and resubmit it as communitywiki so that anybody can edit/add to it. Let me know if that's better. Afaik Apple devices automatically register on smb.
– Mxx
Jan 16 '14 at 5:27






3




3




Why? Just add a bit more info on how these programs work, and explain that they only work on the smb protocol. Maybe add an example of how to use them as well.
– terdon
Jan 16 '14 at 12:37




Why? Just add a bit more info on how these programs work, and explain that they only work on the smb protocol. Maybe add an example of how to use them as well.
– terdon
Jan 16 '14 at 12:37


















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f702309%2fhow-to-get-device-name-from-scan-like-nmap-on-linux%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

QoS: MAC-Priority for clients behind a repeater

Ивакино (Тотемский район)

Can't locate Autom4te/ChannelDefs.pm in @INC (when it definitely is there)