IP address by Domain Name

0 votes

I am trying to get IP address of a domain.. i am using following code

>> import socket
>> socket.gethostbyname('www.google.com')

its giving me following error..

Traceback (most recent call last):
  File "<pyshell#18>", line 1, in <module>
    socket.gethostbyname('www.google.com')
gaierror: [Errno 11001] getaddrinfo failed


What is wrong with my code...is there any method in Python to acquire an IP address from a domain name?
Feb 23 in Cyber Security & Ethical Hacking by Edureka
• 5,760 points
29 views

1 answer to this question.

0 votes

The code you provided is accurate. Perhaps you have a firewall between you and these servers that is preventing the request from being sent?

Hope this will help!

For more, enroll in Cyber security masters program today.

Thank you!

answered Feb 24 by Edureka
• 5,460 points

Related Questions In Cyber Security & Ethical Hacking

0 votes
0 answers

find IP address by domain in go

I am using below code for an ...READ MORE

Feb 16 in Cyber Security & Ethical Hacking by Edureka
• 5,460 points
21 views
+1 vote
1 answer

How to find IP address of nodes in my network?

The IP address of the nodes connected ...READ MORE

answered Feb 9, 2019 in Cyber Security & Ethical Hacking by Omkar
• 69,190 points
1,172 views
0 votes
1 answer

How to find MAC address using IP address?

To find the MAC address, run this ...READ MORE

answered Feb 9, 2019 in Cyber Security & Ethical Hacking by Omkar
• 69,190 points
897 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 2,756 views
0 votes
1 answer
0 votes
1 answer

Can I determine the current IP from a known MAC Address?

ARP may be used to retrieve an ...READ MORE

answered Feb 20 in Cyber Security & Ethical Hacking by Edureka
• 5,460 points
25 views
0 votes
1 answer

how to find host name from IP with out login to the host

To find host name from IP you ...READ MORE

answered Feb 20 in Cyber Security & Ethical Hacking by Edureka
• 5,460 points
30 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP