https://github.com/lynkos/dns-lookup
Net-Centric Computing (CNT 4713) – Project 3.
https://github.com/lynkos/dns-lookup
anaconda conda dns dns-lookup python python3 socket socket-programming yaml yml
Last synced: 9 months ago
JSON representation
Net-Centric Computing (CNT 4713) – Project 3.
- Host: GitHub
- URL: https://github.com/lynkos/dns-lookup
- Owner: lynkos
- Created: 2024-07-02T19:42:20.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-12T17:29:04.000Z (almost 2 years ago)
- Last Synced: 2025-01-27T22:46:49.065Z (over 1 year ago)
- Topics: anaconda, conda, dns, dns-lookup, python, python3, socket, socket-programming, yaml, yml
- Language: Python
- Homepage:
- Size: 399 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DNS Lookup
> The goal of this project is to practice UDP socket programing and understand binary packet structures by developing a simplified DNS lookup client.
> You must create your own socket and cannot use any existing DNS library.
## Requirements
- [x] Anaconda **OR** Miniconda
> [!TIP]
> If you have trouble deciding between Anaconda and Miniconda, please refer to the table below:
>
>
>
> Anaconda
> Miniconda
>
>
>
>
> New to conda and/or Python
> Familiar with conda and/or Python
>
>
> Not familiar with using terminal and prefer GUI
> Comfortable using terminal
>
>
> Like the convenience of having Python and 1,500+ scientific packages automatically installed at once
> Want fast access to Python and the conda commands and plan to sort out the other programs later
>
>
> Have the time and space (a few minutes and 3 GB)
> Don't have the time or space to install 1,500+ packages
>
>
> Don't want to individually install each package
> Don't mind individually installing each package
>
>
>
>
> Typing out entire Conda commands can sometimes be tedious, so I wrote a shell script ([`conda_shortcuts.sh` on GitHub Gist](https://gist.github.com/lynkos/7a4ce7f9e38bb56174360648461a3dc8)) to define shortcuts for commonly used Conda commands.
>
> Example: Delete/remove a conda environment named test_env
>
> * Shortcut command
> ```
> rmenv test_env
> ```
> * Manually typing out the entire command
> ```sh
> conda env remove -n test_env && rm -rf $(conda info --base)/envs/test_env
> ```
>
> The shortcut has 80.8% fewer characters!
>
## Installation
1. Verify that conda is installed
```
conda --version
```
2. Ensure conda is up to date
```
conda update conda
```
3. Enter the directory you want `dns-lookup` to be cloned in
* POSIX
```sh
cd ~/path/to/directory
```
* Windows
```sh
cd C:\Users\user\path\to\directory
```
4. Clone and enter `dns-lookup`
```sh
git clone https://github.com/lynkos/dns-lookup.git && cd dns-lookup
```
5. Create virtual environment from [`environment.yml`](environment.yml)
```sh
conda env create -f environment.yml
```
## Usage
- Activate
dns_env (i.e., virtual environment)conda activate dns_env
- Confirm
dns_env is active
-
dns_env should be in parentheses () or brackets [] before your command prompt, e.g.(dns_env) $
- See which virtual environments are available and/or currently active (active environment denoted with asterisk (*))
conda info --envs
OR conda env list
- Run
mydns.py (domain-name is the domain name to be resolved while root-dns-ip is the IPv4 address of a root DNS server on the internet)python mydns.py domain-name root-dns-ip
- Deactivate
dns_env (i.e., virtual environment) when finishedconda deactivate