• Home
  • Blog
  • ​It is an DNSClient and DNSServer java program.

​It is an DNSClient and DNSServer java program.

0 comments

Write a java program with the name DNSClient.java that carries out the following. The client should be
run as follows:
java DNSClient servername:port_num URL
servername is the name or IP address of the server, port_num is the port number on which the server is
listening on, and URL is the name that should be resolved. If the URL resolution is successful, both the
URL and the resolved IP address should be shown to the user. In addition, the time taken to resolve the
query should also be printed to the user. In case of failure, an appropriate error message (for e.g., “cannot
resolve host name”) should be shown to the user.

Write a java program with the name DNSServer.java that carries out the following. The server should be
run as follows:
java DNSServer port_num
where port_num is the port number to which the server is bound and listening for client requests. The
server should passively listen for client requests and resolve URLs as the requests come in. A packet that
does not have “DNS” as the first field should be ignored by the server. If the requested URL is a fully
qualified domain name (e.g. www.wiu.edu), then the resolution should be done without any modification
of the request. However, if the requested string is not a fully qualified domain name, then the string
should be treated as follows. Any string that does not have a suffix should be treated with the default
domain name wiu.edu. Any string that is of the form x.y should be treated as www.x.y.

About the Author

Follow me


{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}