I am working with Unix and I used nslookup on a machine at my college.
I got the following output:
Server: ...
Address: ...#**
Name: (name of the machine)
Address: ...
With the *s replaced with the actual numbers.
Which of these numbers is the IP address and which is the MAC address?
xxx.xxx.xxx.xxx is the IP
xx:xx:xx:xx:xx:xx is the MAC address
Related
when I run
sudo nmap -sn xxx.xxx.x.*
I got a list of all IPs connected to my router (xxx.xxx.x.1 is gateway),
but i've noticed that the last ip connected doesn't show the MAC address.
Why? How can i fix this?
This is my output:
Starting Nmap 7.60 ( https://nmap.org ) at 2018-04-09 18:38 CEST
Nmap scan report for xxx.xxx.x.1
Host is up (0.0029s latency).
MAC Address: xx:xx:xx:xx:xx:xx (Technicolor)
Nmap scan report for xxx.xxx.x.2
Host is up (0.00014s latency).
MAC Address: xx:xx:xx:xx:xx:xx (Prime Electronics & Satellitics)
Nmap scan report for xxx.xxx.x.3
Host is up (0.16s latency).
MAC Address: xx:xx:xx:xx:xx:xx (Espressif)
Nmap scan report for xxx.xxx.x.46
Host is up (1.1s latency).
MAC Address: xx:xx:xx:xx:xx:xx (Xiaomi Communications)
Nmap scan report for xxx.xxx.x.61
Host is up (1.4s latency).
MAC Address: xx:xx:xx:xx:xx:xx (Unknown)
Nmap scan report for xxx.xxx.x.128
Host is up (8.3s latency).
MAC Address: xx:xx:xx:xx:xx:xx (Motorola Mobility, a Lenovo Company)
Nmap scan report for xxx.xxx.x.254
Host is up.
MAC Address: xx:xx:xx:xx:xx:xx (Unknown)
Nmap scan report for xxx.xxx.x.27
Host is up.
Nmap done: 256 IP addresses (8 hosts up) scanned in 27.83 seconds
As you can see, MAC address is missing from the last host (that is my pc, from which i lunch the command)
The last IP is your scanning machine. Because it is accessed over the loopback interface, it does not have an associated MAC address. The Loopback link type does not have a physical medium, so it does not need or have a "media access control" (MAC) address. It is listed last because Nmap first scanned all the targets that used Ethernet (or similar, like WiFi) links in one group, leaving only your local address in the last group.
Is there a way to find local IPs for devices on your network? I have tried the following in a command line:
Ipconfig
ping 10.51....
arp -a
Is this correct and if not what is?
For Windows
ipconfig
For linux
ifconfig ,
ip addr
in linux you will find ip of eth0 and lo(look up that is for self-connection)
python3.4.3
How can get ip address?
I try this way:
print(socket.gethostbyname(socket.gethostname()))
but only get 127.0.0.1
how can I get the real ip ??
You could try
socket.getfqdn()
or
socket.gethostbyname(socket.getfqdn())
socket.gethostbyname(socket.gethostname()) returns 127.0.0.1 on machines having the hostname in /etc/hosts as 127.0.0.1
What network tool can I use under DOS/windows to find the ip address of a netbios host as easily as is done in Linux?
For example under Linux (ubuntu) I can find the ip address like so:
# nmblookup imac
querying imac on 192.168.1.255
192.168.1.75 imac<00>
Now, this is the IP of the macbook when connected wirelessly
But under windows I can't ping it:
C:\>ping imac
Pinging imac.gateway.2wire.net [192.168.1.68] with 32 bytes of data:
Request timed out.
And the closest tool I could find returns TWO IPs
(it returns the hardwired IP even though it got a different IP by connecting wirelessly
C:\>nslookup imac
Address: 192.168.1.254
Name: imac.gateway.2wire.net
Addresses: 192.168.1.68, 192.168.1.75
Isnt there a windows command to return only the active IP address for the host?
On Windows, you can try
ping -a IP_address (lookup for both DNS name and NetBIOS name)
nslookup IP_address (this command requires you to have an internal DNS server configured)
I like to use ping -a personally.
http://technet.microsoft.com/en-us/library/bb490938.aspx :
Nbtstat.exe -a NETBIOSNAME
Nbtstat.exe -A IP
Come with Windows XP and upward.
nbtstat -a [hostname] -c
This gives IP address of NetBIOS name on Windows
I have an IP address and I want to know what is the server name corresponding to that address. How can I do that?
for example: 10.x.x.x to www. something
Use nslookup [IP] [some DNS server]
For internal networks (like 10.x.x.x), something like this:
> nslookup 10.1.1.10 10.1.1.1
Server: 10.1.1.1
Address: 10.1.1.1#53
10.1.1.10.in-addr.arpa name = my-ip-10.1.1.10.domain.com