1

I'm using python to develop SDN I also wrote a virtual network function just like DHCP,NAT,Firewall,QoS But I want to get computer's hostname from IP like 192.168.2.XXX I try to use arp but it only can find IP and MAC address in packets.

So how should I get hostname from specific IP? Should I try this in DHCP or NAT?

Thanks a lot !!

陳家錡
  • 99
  • 1
  • 11

1 Answers1

0

Try socket.gethostbyaddr() from the module socket

Israel Unterman
  • 13,158
  • 4
  • 28
  • 35