Coding Challenge #96 - WhoisThis challenge is to build your own whois tool and learn about the whois protocol.
Hi this is John with this week’s Coding Challenge. 🙏 Thank you for being one of the 88,891 software developers who have subscribed, I’m honoured to have you as a reader. 🎉 If there is a Coding Challenge you’d like to see, please let me know by replying to this email📧 Coding Challenge #96 - WhoisThis challenge is to build your own version of the whois tool. It’s a tool that allows you to access the Internet domain name and network number directory services. You can get a summary from it’s man page entry:
In practical terms that means you can look up an IP address and see who owns it (please note I’ve cut a lot of the response out to keep this short):
Or you can look up a domain name (again shortened):
🚨Would You Like To Learn Go By Building Coding Challenges! 🚨I’m running the Coding Challenges Learn Go By Building Live Course again in September. It is a live course that runs for three working weeks from September the 15th to the October the 3rd. During the course I’ll introduce you to ever aspect of Go that you need to build the following five real-world projects (based off five of my coding challenges): 🏗️ cat - By building cat you learn how to build and run command line programs in Go. 🏗️ sort - By building sort you learn how to use Go's data structures and control flow to implement sort. 🏗️ curl - By building curl you learn how to write network clients in Go. 🏗️ wc - By building wc you learn how to process text data and handle locales with Go. 🏗️ Memcached (Capstone Project) - By building a Memcached server clone you learn how to build efficient network servers in Go. Having built these five real-world applications you will be well equipped to take on new projects in Go! If you sign up before 25th August you can get $200 off! Use the early bird code: EBLGSEP25 You can sign up and get more details here: https://codingchallenges.fyi/live-courses/learn-go If You Enjoy Coding Challenges Here Are Four Ways You Can Help Support It
The Challenge - Building You Own WhoisThe whois tool allows us to look up registration details for a domain, IP address (or block of) and autonomous system (AS). If you’re not aware ASes are used in BGP routing and are a key part of the infrastructure of the Internet. The whois tool relies on the WHOIS protocol which is defined in RFC 3912. In this coding challenge you’re going to implement your own whois tool that will use the protocol to lookup details of hosts and IP addresses. Step ZeroAs always we begin at the beginning! Set up your development environment, pick you programming language and create your git repo of choice! Step 1In this step your goal is to accept a domain name as the only argument to your whois tool and then to send a query to IANA on port 43. IANA is the Internet Assigned Numbers Authority and they’re responsible for keeping the Internet working. Essentially they manage the top level domain names and DNS Root, coordinate the global pool of IP addresses and AS numbers and handle protocol assignments. IANA can be queried using the host: After sending the query your whois tool should receive the response and print it. For example:
N.B. I’ve snipped a lot of text out of here for brevity. Step 2In this step your goal is to parse the response. You might like to throw away blank lines and comments, putting the rest into a suitable data structure. Hint the interesting bits are like keys and values in most programming languages. Step 3In this step your goal is to use the data structure you’ve just built to then use the Then send that server the same query as before and read and print the response. Don’t forget you can use the real whois tool to check your solution (and save me making this coding challenge way too long 😀). Step 4In this step your goal is to parse the response you just retrieved and if there is another Step 5In this step your goal is to check your solution works when a user provides an IP address instead of a domain name. Then hunt through your email spam folder and look at the headers for one of the spam messages. I found one that was sent by the IP address: Going FurtherWhois is being deprecated in favour of the Registration Data Access Protocol (RDAP), if you want to take this project further consider adding support for RDAP. Two Other Ways I Can Help You:
Share Your Solutions!If you think your solution is an example other developers can learn from please share it, put it on GitHub, GitLab or elsewhere. Then let me know via Bluesky or LinkedIn or just post about it there and tag me. Alternately please add a link to it in the Coding Challenges Shared Solutions Github repo Request for FeedbackI’m writing these challenges to help you develop your skills as a software engineer based on how I’ve approached my own personal learning and development. What works for me, might not be the best way for you - so if you have suggestions for how I can make these challenges more useful to you and others, please get in touch and let me know. All feedback greatly appreciated. You can reach me on Bluesky, LinkedIn or through SubStack Thanks and happy coding! John Invite your friends and earn rewardsIf you enjoy Coding Challenges, share it with your friends and earn rewards when they subscribe. |
Don't miss a thing Confirm your subscription Hi there, Thanks for subscribing to fitgirl-repacks.site! To get you up and running, please confirm your email address by clicking below. This will set you up with a WordPress.com account you can use to manage your subscription preferences. By clicking "confirm email," you agree to the Terms of Service and have read the Privacy Policy . Confirm email ...
Comments
Post a Comment