Domain Name Lookup Tool – Tkinter Projects 8

In this video I’ll show you how to build a cool domain name lookup tool with Tkinter and Python.

We’ll query whois information using the python-whois library.

It will return all the whois information about any given domain name. We’ll output that info to a Tkinter text box.

Python Code: who.py
(Github Code)

from tkinter import *
import whois

root = Tk()
root.title("Domain Name Lookup")
root.geometry('500x550')

# Lookup Function
def lookup():
	# Delete Text in box
	my_text.delete(1.0, END)

	# Get Domain Info
	domain = my_entry.get()
	domain_info = whois.whois(domain)

	# Loop the output
	for key, value in domain_info.items():
		# Output to text box
		my_text.insert(1.0, f'{key} : {value}' + '\n\n')

# GUI
my_frame = LabelFrame(root, text="Lookup Domain Name")
my_frame.pack(pady=20)

my_entry = Entry(my_frame, font=("Helvetica", 18))
my_entry.grid(row=0, column=0, pady=10, padx=10)

my_button = Button(my_frame, text="Lookup Domain", command=lookup)
my_button.grid(row=0, column=1, padx=10)

my_text = Text(root, width=50)
my_text.pack()


root.mainloop()


John Elder

John is the CEO of Codemy.com where he teaches over 100,000 students how to code! He founded one of the Internet's earliest advertising networks and sold it to a publicly company at the height of the first dot com boom. After that he developed the award-winning Submission-Spider search engine submission software that's been used by over 3 million individuals, businesses, and governments in over 42 countries. He's written several Amazon #1 best selling books on coding, and runs a popular Youtube coding channel.

View all posts

Add comment

John Elder

John is the CEO of Codemy.com where he teaches over 100,000 students how to code! He founded one of the Internet's earliest advertising networks and sold it to a publicly company at the height of...