What I am trying to do is a reverse lookup to find the name from IP. The switches I am using don't have shell access so trying Python and getting failures.
socket.gethostbyaddr() and socket.gethostbyname() both work for the device's IP and hostname but not for any other. I can ping by hostname from the CLI so know DNS is working for the device. Is there something I need to do to enable the external lookup? Error I get is socket.gaierror: [Errno -2] host nor service provided, or not known
Sorry, mis-clicked on "me too" - please ignore that.
Could you check the permissions of the user you are connected at? You can do it this way by running:
>>> import os
>>> os.system('whoami')
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips.
How to use Community
New member guide
Log in to Community