Get IP Address of Machine from Hostname or Mac-address
Is that possible to get the IP address of my machine from the hostname or the machine's own mac address?
If yes, how?
If not, could you suggest an alternative way?
networking command-line ip
|
show 5 more comments
Is that possible to get the IP address of my machine from the hostname or the machine's own mac address?
If yes, how?
If not, could you suggest an alternative way?
networking command-line ip
2
Of your system or a remote system?
– muru
Feb 13 '15 at 23:06
4
I'm not sure exactly what you're trying to accomplish, but thehostname --all-ip-addresses
command relates the hostname to IPs,nslookup
anddig
can be used for general DNS resolving and thearp -na
command can list all IPs and MAC addresses in the local network that you have connected to at some point.
– muru
Feb 13 '15 at 23:15
1
ping -c1 hostname
– Panther
Feb 13 '15 at 23:24
1
@muru is correct. If the machine is one hop away,arp
will help you find the IP from the MAC address.nmap
orzenmap
can also be helpful to identify machines on your network
– noleti
Feb 13 '15 at 23:32
1
In addition to @noleti's suggestion: superuser.com/q/261818/334516
– muru
Feb 13 '15 at 23:33
|
show 5 more comments
Is that possible to get the IP address of my machine from the hostname or the machine's own mac address?
If yes, how?
If not, could you suggest an alternative way?
networking command-line ip
Is that possible to get the IP address of my machine from the hostname or the machine's own mac address?
If yes, how?
If not, could you suggest an alternative way?
networking command-line ip
networking command-line ip
edited Feb 15 '15 at 16:59
Seth♦
34.2k26110162
34.2k26110162
asked Feb 13 '15 at 23:05
FahadkalisFahadkalis
12114
12114
2
Of your system or a remote system?
– muru
Feb 13 '15 at 23:06
4
I'm not sure exactly what you're trying to accomplish, but thehostname --all-ip-addresses
command relates the hostname to IPs,nslookup
anddig
can be used for general DNS resolving and thearp -na
command can list all IPs and MAC addresses in the local network that you have connected to at some point.
– muru
Feb 13 '15 at 23:15
1
ping -c1 hostname
– Panther
Feb 13 '15 at 23:24
1
@muru is correct. If the machine is one hop away,arp
will help you find the IP from the MAC address.nmap
orzenmap
can also be helpful to identify machines on your network
– noleti
Feb 13 '15 at 23:32
1
In addition to @noleti's suggestion: superuser.com/q/261818/334516
– muru
Feb 13 '15 at 23:33
|
show 5 more comments
2
Of your system or a remote system?
– muru
Feb 13 '15 at 23:06
4
I'm not sure exactly what you're trying to accomplish, but thehostname --all-ip-addresses
command relates the hostname to IPs,nslookup
anddig
can be used for general DNS resolving and thearp -na
command can list all IPs and MAC addresses in the local network that you have connected to at some point.
– muru
Feb 13 '15 at 23:15
1
ping -c1 hostname
– Panther
Feb 13 '15 at 23:24
1
@muru is correct. If the machine is one hop away,arp
will help you find the IP from the MAC address.nmap
orzenmap
can also be helpful to identify machines on your network
– noleti
Feb 13 '15 at 23:32
1
In addition to @noleti's suggestion: superuser.com/q/261818/334516
– muru
Feb 13 '15 at 23:33
2
2
Of your system or a remote system?
– muru
Feb 13 '15 at 23:06
Of your system or a remote system?
– muru
Feb 13 '15 at 23:06
4
4
I'm not sure exactly what you're trying to accomplish, but the
hostname --all-ip-addresses
command relates the hostname to IPs, nslookup
and dig
can be used for general DNS resolving and the arp -na
command can list all IPs and MAC addresses in the local network that you have connected to at some point.– muru
Feb 13 '15 at 23:15
I'm not sure exactly what you're trying to accomplish, but the
hostname --all-ip-addresses
command relates the hostname to IPs, nslookup
and dig
can be used for general DNS resolving and the arp -na
command can list all IPs and MAC addresses in the local network that you have connected to at some point.– muru
Feb 13 '15 at 23:15
1
1
ping -c1 hostname
– Panther
Feb 13 '15 at 23:24
ping -c1 hostname
– Panther
Feb 13 '15 at 23:24
1
1
@muru is correct. If the machine is one hop away,
arp
will help you find the IP from the MAC address. nmap
or zenmap
can also be helpful to identify machines on your network– noleti
Feb 13 '15 at 23:32
@muru is correct. If the machine is one hop away,
arp
will help you find the IP from the MAC address. nmap
or zenmap
can also be helpful to identify machines on your network– noleti
Feb 13 '15 at 23:32
1
1
In addition to @noleti's suggestion: superuser.com/q/261818/334516
– muru
Feb 13 '15 at 23:33
In addition to @noleti's suggestion: superuser.com/q/261818/334516
– muru
Feb 13 '15 at 23:33
|
show 5 more comments
2 Answers
2
active
oldest
votes
Of all the suggestions in the comments this one seems easiest.
sudo apt-get install arp-scan
sudo arp-scan --interface=wlan0 --localnet
where wlan0 is your interface if your on a wire you'll likely change wlan0 to eth0. You can find out your interface with ifconfig
you'll get output similar to this that provides The IP and MAC Address of each machine on your local subnet.
$ sudo arp-scan --interface=eth0 --localnet
Interface: eth0, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.8.1 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)
192.168.15.2 XX:XX:XX:XX:XX:XX NETGEAR
192.168.15.24 XX:XX:XX:XX:XX:XX BROTHER INDUSTRIES, LTD.
192.168.15.103 XX:XX:XX:XX:XX:XX GIGA-BYTE TECHNOLOGY CO.,LTD.
Sources:
1) http://www.binarytides.com/scan-the-local-network-with-arp-scan-on-ubuntu/
2) https://superuser.com/questions/261818/how-can-i-list-all-ips-in-the-connected-network-through-terminal-preferably
3)Experience
2
Today I learned the android app I use called fing is basically arp-scan
– geoffmcc
Feb 14 '15 at 15:47
add a comment |
Technically it is possibly but Logically not. We can get IP by pinging hostname only if it is bind to that certain IP. In local host its hosts file do that work on business network it's DNS which do that work & on internet as well it's DNS but A records/cname which do that work. We can also get IPs assigned ot hostname set for particular MAC id, but that programatically possible not sure if you can do that with simple commands
To know what is your public IP address : www.ipconfig.in
Edit:
getent hosts <hostname> | awk
This works locally aswell.
New contributor
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f585286%2fget-ip-address-of-machine-from-hostname-or-mac-address%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
Of all the suggestions in the comments this one seems easiest.
sudo apt-get install arp-scan
sudo arp-scan --interface=wlan0 --localnet
where wlan0 is your interface if your on a wire you'll likely change wlan0 to eth0. You can find out your interface with ifconfig
you'll get output similar to this that provides The IP and MAC Address of each machine on your local subnet.
$ sudo arp-scan --interface=eth0 --localnet
Interface: eth0, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.8.1 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)
192.168.15.2 XX:XX:XX:XX:XX:XX NETGEAR
192.168.15.24 XX:XX:XX:XX:XX:XX BROTHER INDUSTRIES, LTD.
192.168.15.103 XX:XX:XX:XX:XX:XX GIGA-BYTE TECHNOLOGY CO.,LTD.
Sources:
1) http://www.binarytides.com/scan-the-local-network-with-arp-scan-on-ubuntu/
2) https://superuser.com/questions/261818/how-can-i-list-all-ips-in-the-connected-network-through-terminal-preferably
3)Experience
2
Today I learned the android app I use called fing is basically arp-scan
– geoffmcc
Feb 14 '15 at 15:47
add a comment |
Of all the suggestions in the comments this one seems easiest.
sudo apt-get install arp-scan
sudo arp-scan --interface=wlan0 --localnet
where wlan0 is your interface if your on a wire you'll likely change wlan0 to eth0. You can find out your interface with ifconfig
you'll get output similar to this that provides The IP and MAC Address of each machine on your local subnet.
$ sudo arp-scan --interface=eth0 --localnet
Interface: eth0, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.8.1 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)
192.168.15.2 XX:XX:XX:XX:XX:XX NETGEAR
192.168.15.24 XX:XX:XX:XX:XX:XX BROTHER INDUSTRIES, LTD.
192.168.15.103 XX:XX:XX:XX:XX:XX GIGA-BYTE TECHNOLOGY CO.,LTD.
Sources:
1) http://www.binarytides.com/scan-the-local-network-with-arp-scan-on-ubuntu/
2) https://superuser.com/questions/261818/how-can-i-list-all-ips-in-the-connected-network-through-terminal-preferably
3)Experience
2
Today I learned the android app I use called fing is basically arp-scan
– geoffmcc
Feb 14 '15 at 15:47
add a comment |
Of all the suggestions in the comments this one seems easiest.
sudo apt-get install arp-scan
sudo arp-scan --interface=wlan0 --localnet
where wlan0 is your interface if your on a wire you'll likely change wlan0 to eth0. You can find out your interface with ifconfig
you'll get output similar to this that provides The IP and MAC Address of each machine on your local subnet.
$ sudo arp-scan --interface=eth0 --localnet
Interface: eth0, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.8.1 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)
192.168.15.2 XX:XX:XX:XX:XX:XX NETGEAR
192.168.15.24 XX:XX:XX:XX:XX:XX BROTHER INDUSTRIES, LTD.
192.168.15.103 XX:XX:XX:XX:XX:XX GIGA-BYTE TECHNOLOGY CO.,LTD.
Sources:
1) http://www.binarytides.com/scan-the-local-network-with-arp-scan-on-ubuntu/
2) https://superuser.com/questions/261818/how-can-i-list-all-ips-in-the-connected-network-through-terminal-preferably
3)Experience
Of all the suggestions in the comments this one seems easiest.
sudo apt-get install arp-scan
sudo arp-scan --interface=wlan0 --localnet
where wlan0 is your interface if your on a wire you'll likely change wlan0 to eth0. You can find out your interface with ifconfig
you'll get output similar to this that provides The IP and MAC Address of each machine on your local subnet.
$ sudo arp-scan --interface=eth0 --localnet
Interface: eth0, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.8.1 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)
192.168.15.2 XX:XX:XX:XX:XX:XX NETGEAR
192.168.15.24 XX:XX:XX:XX:XX:XX BROTHER INDUSTRIES, LTD.
192.168.15.103 XX:XX:XX:XX:XX:XX GIGA-BYTE TECHNOLOGY CO.,LTD.
Sources:
1) http://www.binarytides.com/scan-the-local-network-with-arp-scan-on-ubuntu/
2) https://superuser.com/questions/261818/how-can-i-list-all-ips-in-the-connected-network-through-terminal-preferably
3)Experience
edited Mar 20 '17 at 10:18
Community♦
1
1
answered Feb 14 '15 at 15:24
Elder GeekElder Geek
26.5k952126
26.5k952126
2
Today I learned the android app I use called fing is basically arp-scan
– geoffmcc
Feb 14 '15 at 15:47
add a comment |
2
Today I learned the android app I use called fing is basically arp-scan
– geoffmcc
Feb 14 '15 at 15:47
2
2
Today I learned the android app I use called fing is basically arp-scan
– geoffmcc
Feb 14 '15 at 15:47
Today I learned the android app I use called fing is basically arp-scan
– geoffmcc
Feb 14 '15 at 15:47
add a comment |
Technically it is possibly but Logically not. We can get IP by pinging hostname only if it is bind to that certain IP. In local host its hosts file do that work on business network it's DNS which do that work & on internet as well it's DNS but A records/cname which do that work. We can also get IPs assigned ot hostname set for particular MAC id, but that programatically possible not sure if you can do that with simple commands
To know what is your public IP address : www.ipconfig.in
Edit:
getent hosts <hostname> | awk
This works locally aswell.
New contributor
add a comment |
Technically it is possibly but Logically not. We can get IP by pinging hostname only if it is bind to that certain IP. In local host its hosts file do that work on business network it's DNS which do that work & on internet as well it's DNS but A records/cname which do that work. We can also get IPs assigned ot hostname set for particular MAC id, but that programatically possible not sure if you can do that with simple commands
To know what is your public IP address : www.ipconfig.in
Edit:
getent hosts <hostname> | awk
This works locally aswell.
New contributor
add a comment |
Technically it is possibly but Logically not. We can get IP by pinging hostname only if it is bind to that certain IP. In local host its hosts file do that work on business network it's DNS which do that work & on internet as well it's DNS but A records/cname which do that work. We can also get IPs assigned ot hostname set for particular MAC id, but that programatically possible not sure if you can do that with simple commands
To know what is your public IP address : www.ipconfig.in
Edit:
getent hosts <hostname> | awk
This works locally aswell.
New contributor
Technically it is possibly but Logically not. We can get IP by pinging hostname only if it is bind to that certain IP. In local host its hosts file do that work on business network it's DNS which do that work & on internet as well it's DNS but A records/cname which do that work. We can also get IPs assigned ot hostname set for particular MAC id, but that programatically possible not sure if you can do that with simple commands
To know what is your public IP address : www.ipconfig.in
Edit:
getent hosts <hostname> | awk
This works locally aswell.
New contributor
edited 7 hours ago
An0n
89420
89420
New contributor
answered Jan 11 at 14:36
BellaBella
11
11
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- 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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f585286%2fget-ip-address-of-machine-from-hostname-or-mac-address%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
2
Of your system or a remote system?
– muru
Feb 13 '15 at 23:06
4
I'm not sure exactly what you're trying to accomplish, but the
hostname --all-ip-addresses
command relates the hostname to IPs,nslookup
anddig
can be used for general DNS resolving and thearp -na
command can list all IPs and MAC addresses in the local network that you have connected to at some point.– muru
Feb 13 '15 at 23:15
1
ping -c1 hostname
– Panther
Feb 13 '15 at 23:24
1
@muru is correct. If the machine is one hop away,
arp
will help you find the IP from the MAC address.nmap
orzenmap
can also be helpful to identify machines on your network– noleti
Feb 13 '15 at 23:32
1
In addition to @noleti's suggestion: superuser.com/q/261818/334516
– muru
Feb 13 '15 at 23:33