Need help writing Java simple DNS client with specific DNS server - java

I'm a CS student working on a Java DNS resolver client assignment. My DNS resolver must accept as input a DNS root server IP and a domain name. Then the program must query the DNS root server given by the user, and iteratively query any intermediate servers (which I understand will be found in "the Authority and Additional Information sections" of the reply) until I have come across the IP of the domain entered by the user. I understand that the information I am looking for is found in the RR but I am stuck on querying a specific DNS root server as well as how to get the RR in order to proceed from there. I have looked around but have not had much luck with finding any guidance to do this in Java using the standard libraries I cannot use any DNS library (DNSQuery, SimpleResolver, etc). I am hoping someone can point me in the right direction.
This is an example of what I have to do :
>java dns_resolver 202.12.27.33 cs.poly.edu
DNS server to query: 202.12.27.33
Reply received. Content overview:
0 Answers
6 Intermediate Name Servers
7 Additional Information Records
Answers section:
Authoritative Section:
Name: edu Name Server: l.edu-servers.net
Name: edu Name Server: a.edu-servers.net
Name: edu Name Server: f.edu-servers.net
Name: edu Name Server: c.edu-servers.net
Additional Information Section:
. . .
until I reach 1 in the Answer section containing the IP of the domain entered by the user.
Thanks

It sounds like the difficulty in the assignment is in implementing the DNS protocol yourself (otherwise you'd be able to use SimpleResolver, etc). Here's a page with details of the DNS protocol: RFC 1035 §4.1. Use that as a guide to build the request, then use java socket I/O to send the request and receive the response.

Related

javax.net.ssl.SSLHandshakeException: No subject alternative DNS name matching <host> found

My Java server is using a rest service to retrieve information. Every several months I get an exception from java:
javax.net.ssl.SSLHandshakeException: No subject alternative DNS name
matching found.
This exception happens for few seconds and goes away until next time. From reading in the internet, I saw it's a problem of the remote server and its certificate. I talked to the support of the service but they say they updated the certificate on January and nothing was done regarding the certificate.
What/where else can I check or tell them to check in order to avoid this error?
Thanks

SmbException: A duplicate name exists on the network: how to prove that a few servers have the same DNS name

Need your advice about the following:
We try to get file from another server in our local network by SMB
When we call server by IP everything works file
When we call server by DNS name we get an exception: jcifs.smb.SmbException: A duplicate name exists on the network
I googled the similar questions and found that it could happen when a few servers have the same DNS name.
Could you please advise me how to prove it to our network administrators? Because they say that it’s impossible and every server has the only DNS name in our local network.
Thank you!
You may also have a server which is registered under 2 different domains, and a program which tries to access this server without mentioning a domain.
If such is the case, if you enter:
nslookup <server>.<expected domain>
you may get:
Non-authoritative answer:
Name: <server>.<expected domain, for instance your company's domain>
Address: <IP>
And if you enter:
nslookup <server>
(note that you did not mention any domain) you may get:
Non-authoritative answer:
Name: <server>.<UNexpected domain #2>
Address: <IP>
If this is the case, we have to unregister your server from the unexpected domain and everything should go back to normal.

your connection is not private in my application

Here is my site https://sample.in I placed the another webapplicaton in the same domain,its home page url is
http://www.sample.in:8080/anotherapplication-name/login.jsp
the above url is login page,when enter the credentials its navigating to main site url like
https://sample.in/anotherapplication-name/NavigationFrameset.jsp
In the browser i am getting the following message
Your connection is not private
Attackers might be trying to steal your information from www.ilovesalesevents.in (for example, passwords, messages, or credit cards). NET::ERR_CERT_COMMON_NAME_INVALID
Please any help!!!!!!!
Your cert does not match your domain name.
You're not clear which application is "another", but the domain names [www.]sample.in resolve to 192.254.254.73
which is using a cert that was issued to [www.]vb.in -- and also expired 3 months ago (Feb 18). [www.]vb.in doesn't exist according to all authoritative DNS servers except one I couldn't reach,
and my ISPs have (presumably stale) records mapping these names to 92.242.140.21 and 198.105.244.11 which both don't respond at all.
For most uses of SSL/TLS including HTTPS, the server cert must contain the domain name(s) "of" the server, or more exactly the domain name(s) used to reach the server. If you want to use domain name(s) [www.]sample.in, you must get a certificate for that domain name(s).

How to create multiple user in BIM server ? Version : 1.3.0-RC6-2014-03-14

I am new in BIM Server , trying to figure out how BIM server and IFC model sync together.
I made connectivity to local BIM-server from a java application. I use the default settings as described in https://github.com/opensourceBIM/BIMserver/wiki/Setup .
Now, when I am going to create a new user it only ask for mail address , username and Access level. No password field . So, I can not do log in using that user.
"Send Password Reset" is giving the following error :
" Could not connect to SMTP host: localhost, port: 25 (java.net.ConnectException: Connection refused: connect) " .
Whether it is a BIM server version problem or I am missing something ?
I have not found any well prepared Documentation or tutorial on BIM server. My goal is to check how the BIM server can replace the ftp server that we are using now to store IFC files.
Thanks in advance
-Nazar-E-Bukhari
I have posted this in BIM server Issues. I am posting the answer if someone is also searching for the same solution.
"It's really bad practice to have an administrator set the user's passwords. How is the administrator going to give the passwords to those users? (I agree with him, but as because I am testing it in my localhost, I have no mail server configured)
Setup a working e-mail server, or better yet, use a third party's server. For example have a look at mailgun, sendgrid or postmark."

JavaMail - Invalid HELO name

I used to run a server app that sends an e-mails each 2 hours, but sometimes i get the error below:
Não foi possível enviar a mensagem.
Mensagem: com.sun.mail.smtp.SMTPSendFailedException: 550 Access denied - Invalid HELO name (See RFC2821 4.1.1.1)
Jan 07, 2013 1:00:32 PM job_hidrojato.comunicacao.email.Email run
SEVERE: null
com.sun.mail.smtp.SMTPSendFailedException: 550 Access denied - Invalid HELO name (See RFC2821 4.1.1.1)
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1388)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:959)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:583)
at javax.mail.Transport.send0(Transport.java:169)
at javax.mail.Transport.send(Transport.java:98)
at job_hidrojato.comunicacao.email.Email.run(Email.java:186)
at java.lang.Thread.run(Thread.java:722)
I've already tried to explicitly define the mail.smtp.localhost using the code below, where "HADES" is the hostname of my server, but it didn't work.
props.put("mail.smtp.localhost", "HADES");
The error log gerenated after this change is the same, so I think that the problem isn't the hostname parameter. I already read the links below but again, didn't work, so I'm running out of alternatives to solve this problem, and any help would be appreciated :)
Invalid HELO name in JavaMail
550 Access denied - Invalid HELO name
If you look up RFC2811 section 4.1.1.1 it says (emphasis mine):
These commands are used to identify the SMTP client to the SMTP
server. The argument field contains the fully-qualified domain name
of the SMTP client if one is available. In situations in which the
SMTP client system does not have a meaningful domain name (e.g., when
its address is dynamically allocated and no reverse mapping record is
available), the client SHOULD send an address literal (see section
4.1.3), optionally followed by information that will help to identify
the client system.
The name HADES is not a fully qualified domainname (which is hostname+domain, eg www.example.com, some definitions of FQDN also require a dot a the end (ie www.example.com. but I am unsure if that is required by SMTP). If you don't have a FQDN, you should use an address literal (see section 4.1.3 Address Literals), which basically is the IP address.
Also be sure that your SMTP server is not actively restricting access to unknown or unauthenticated hosts.

Categories

Resources