Python Website Scanner Tutorial – 3 – IP Address

Felipe , – The worst service ever! lost all my info – Just host is a scam service that will only give you problems last week I lost all my information because of a server side IP problem I try to restore a backup and found that the didn’t backup for days my service, even if I have the backup Pro plan, and the only answer you get “Seema T We really sorry for the inconvenience you are facing. I have checked it with our higher tech,Only those are the backup available from that date. F Who would respond for this I mean is part of your service? 9:32:13 PM F Right? 9:32:38 PM Seema T Yes its a part of our service we provide you with.” A very bad service not recommended for anyone

Join our community below for all the latest videos and tutorials!

Website –
Discord –
GitHub –
Reddit –
LinkedIn –
Facebook –
Twitter –
Instagram –
Twitch –

TNBC Donations: b6e21072b6ba2eae6f78bc3ade17f6a561fa4582d5494a5120617f2027d38797


  • Mathew Scolari
    Posted at 03:31h, 17 October

    Im getting an error at compile saying that the list index is out of range.

  • liendre
    Posted at 04:05h, 17 October

    It can be done like this:

    from socket import gethostbyname

    def get_ip_address(url)
    return gethostbyname(url)

    Hope it helps!

  • Mohhinder Suresh
    Posted at 05:44h, 17 October

    You could replace your results line with this:

    results = str([3]

    Posted at 01:21h, 26 October

    is this only for mac?

  • tyubnm564
    Posted at 13:33h, 08 December

    "has address" will not exist for another languages 🙂

  • dhg1234
    Posted at 11:34h, 20 December

    use split(' ') function

  • Tactical Almonds
    Posted at 23:38h, 26 December

    So doing this on windows with ping and its sort of the same. Running into the problem of trying to truncate the final ~22 characters from the results. Any suggestions??

    Edit: I got it to work.

  • Carson
    Posted at 09:29h, 01 January

    Where does he get the ava@computer from?
    I get
    'host ' is not recognized as an internal or external command,
    operable program or batch file.
    I am assuming that is because I dont have the ava@computer thing? I am new to this 🙂

  • malin hess
    Posted at 21:43h, 29 September

    import socket

    # a simple example

    def main():

    # get fully qualified domain name
    ip = raw_input('Enter url ')

    fqdn = socket.gethostbyname(socket.getfqdn(ip))

    print fqdn

    if _name_ == '__main__':

  • baysunny
    Posted at 05:49h, 01 May

    'host' is not recognized as an internal or external command, operable program or batch file.
    what should i do??

  • Abeer Hussain
    Posted at 07:46h, 01 September

    we can also use socket.gethostbyname() to get ip address

  • Felix Brumm
    Posted at 12:55h, 11 November

    You could Just use grep lol

  • fady mohsen
    Posted at 15:37h, 16 January

    how can i get that ava@computer in windows

  • Alpha Omega
    Posted at 11:36h, 19 January

    C:XXXXXXXPycharmProjectspySCvenvScriptspython.exe C:/XXXXXXX/PycharmProjects/pySC/
    'host' is not recognized as an internal or external command,
    operable program or batch file.
    Traceback (most recent call last):
    File "C:/XXXXXXX/PycharmProjects/pySC/", line 11, in <module>
    File "C:/XXXXXXX/PycharmProjects/pySC/", line 9, in get_ip_address
    return results[marker:].spltilines()[0]
    AttributeError: 'str' object has no attribute 'spltilines'

  • ethar shrouf
    Posted at 14:07h, 28 May

    another way using regular expression
    import os,re
    def get_ip_address(url):
    command="host "+url
    regex = re.compile(pattern)
    test = regex.findall(process)
    for i in test:

  • Siddharth Kumar Sah
    Posted at 18:23h, 09 September

    If you are on Windows and Python, here's one east way to do it:

    import socket

    def get_ip_address(url):
    results = socket.gethostbyname(url)
    return results


  • Eugene Lytvynenko
    Posted at 16:18h, 18 January

    You can simply use "dig +short " instead of "host ". That'll give you just an IP

  • C V
    Posted at 20:45h, 24 May

    hi brother

    import socket

    this will return ip

  • Lenora Leivi
    Posted at 18:09h, 20 July

    not showing any results, no errors.. 🙁 pls help

  • noo no
    Posted at 15:15h, 26 October

    import socket

  • money man
    Posted at 06:39h, 04 December