Find Jobs
Hire Freelancers

URGENT: DNS resolving program in JAVA - with optional BONUS!

$30-5000 USD

已取消
已发布大约 16 年前

$30-5000 USD

货到付款
The task is to write a simple command line DNS resolver in Java without using any of the DNS library functions. It needs to be similar to the 'dig' utility in Linux machines. However, it **only** needs to support type A queries. That is, takes a hostname as an argument and returns an IP address. # NOTE: You only need to support TYPE A records! **Example:** **%** dns_resolver [login to view URL] [login to view URL] = [login to view URL] The program will bypass the local DNS server on the machine and instead will use **iterative** queries to obtain the IP address of the hostname. Hence, the first query will go to one of the root name servers (static IP's you will define in the program), then the TLD, and then the authoritative name server depending on how many iterations are needed. You must create your OWN DNS messages, open your own sockets, send your own query messages and listen for response messages. It is NOT acceptable to call DNS library functions. ? ## Deliverables # **Specifications:** Command line, Java DNS Resolver for Type A records. Takes in the hostname as an argument and outputs IP address using iterative queries to name servers. 1) You will need to use iterative queries to the Root name servers (IP addresses are obtainable from <[login to view URL]>), the TLD, authoritative name server and so on. Depending on the hostname, the iterations will all be [login to view URL] **cannot** use recursive queries. See attached diagram for further clarification: 2) The program will take a hostname and return its corresponding IP address by first contacting one of the root name servers, then iteratively going to each name server (TLD, authoritive etc) until its IP address is found. Once found, it will return the IP address and exit. The program should only support queries for type A records. However, to do this, your resolver will also need to understand the following DNS resource record types: * **CNAME** records: Note that the hostname input to your program could actually be aCNAME (i.e. canonical name). Your program should be able to find the corresponding IP address. Sometimes it may be possible that one CNAME points to another CNAME and so on, thus creating a chain. If such a chain exists, your code must continue to follow the CNAME chain until it either finds an IP address at the end of the chain or process that the CNAME chain is misconfigured (i.e. the chain of CNAMEs leads to a hostname that does not exist). * **SOA** records: SOA records are sent to indicate that a requested name does not exist. * **NS** records: In response to certain queries, your program will receive back NS records, which identify servers that should be queried next (note that the IP address for these servers are usually in the additional information field of the DNS message). Your program should essentially follow this chain of NS records starting at the DNS root server until you find the name server, which contains the Type A address for the hostname. You MUST use **UDP** sockets since DNS typically uses UDP for sending queries. Your program should choose a random socket number which is greater than 1023. Your program will need to create the DNS query message, encapsulate each message within a UDP segment and then transmit the segment through the datagram socket. Your program must also receive DNS response messages and interpret their content. Using any DNS libraries is not permitted - all code needs to be written from scratch. Your program should be well documented, and should be as simple as possible. The attached image, illustrates an example of how your program must operate. Notice that the DNS resolver bypasses the local DNS server and directly sends the query to one of the root DNS servers. In this particular example, the DNS resolver requires 3 iterations (first query to the root server, second query to the TLD server and the final query to the authoritative name server). Note that depending on the hostname the number of iterations could be less or more. # **Error handling:** 1) Since there will be redundant name servers along the path, you will need to ensure that if one server is down, another is chosen. 2) Ensure a timer is present to handle unresponsive name servers, which would cause the program to use an alternative name server, if available. 3) In the event that the supplied hostname is invalid or does not exist, it should return a "hostname is invalid" and exit. # **Bonus Payment:** This project has the following bonuses, please indicate in your bid if you would like to attempt any of the bonuses: 1) 20% bonus payment: If the project is finished within 12 hours 2) **40%** bonus payment for **Reverse lookup** - if you can implement a reverse lookup function (called by a **-r** flag) which takes in an IP address and prints is corresponding hostname (if any) by quering the [login to view URL] domain. This is a bit challenging, so whatever solution you come up with, please be sure to document it so its easy to understand. # **Test Cases:** These are some test cases, please ensure your program is able to handle them properly: **Straightforward ones:** [login to view URL] [login to view URL] [login to view URL] [login to view URL] **No hostnames exist:** [login to view URL] [login to view URL] **Cname involved:** [login to view URL] [login to view URL] **A bit complex** (the sequence of iterative queries will require you to resolve the IP address for a NS (nameserver) along the way). [login to view URL] [login to view URL] [login to view URL] [login to view URL] [login to view URL] **More complex** (may enquire multiple CNAMES or in which you may need to resolve the IP address for a NS and also encounter a CNAME, etc) [login to view URL] [login to view URL] **Note** - IF you're on a Linux machine, you should use ?&#8364;&#339;dig + trace hostname?&#8364; to observe the chain of iterative queries and to confirm the output of your program. ## Platform Linux Java version "1.5.0_07" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03) Java HotSpot(TM) Server VM (build 1.5.0_07-b03, mixed mode)
项目 ID: 3895098

关于此项目

6提案
远程项目
活跃16 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
6威客以平均价$375 USD来参与此工作竞价
用户头像
See private message.
$204 USD 在3天之内
5.0 (124条评论)
7.1
7.1
用户头像
See private message.
$170 USD 在3天之内
4.9 (211条评论)
6.6
6.6
用户头像
See private message.
$425 USD 在3天之内
5.0 (41条评论)
6.1
6.1
用户头像
See private message.
$1,275 USD 在3天之内
5.0 (1条评论)
4.1
4.1
用户头像
See private message.
$126.65 USD 在3天之内
5.0 (2条评论)
4.0
4.0
用户头像
See private message.
$46.75 USD 在3天之内
5.0 (3条评论)
1.7
1.7

关于客户

AUSTRALIA的国旗
Meadowbank, Australia
5.0
17
付款方式已验证
会员自3月 21, 2011起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。