Bad behavior while checking if domain exist
<p>I want to check if a domain exist, so here is my code : </p>

<pre><code>try {
    InetAddress inetAddress = InetAddress.getByName("ouestfrance-ecole.com");
    System.out.println(inetAddress.getHostName());
    System.out.println(inetAddress.getHostAddress());
} catch (UnknownHostException e) {
    e.printStackTrace();
}
</code></pre>

<p>And the response is : </p>

<pre><code>java.net.UnknownHostException: ouestfrance-ecole.com
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:849)
at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1202)
at java.net.InetAddress.getAllByName0(InetAddress.java:1153)
at java.net.InetAddress.getAllByName(InetAddress.java:1083)
at java.net.InetAddress.getAllByName(InetAddress.java:1019)
at java.net.InetAddress.getByName(InetAddress.java:969)
at MainApp.main(MainApp.java:18)
</code></pre>

<p>But If I put ouestfrance-ecole.com in my browser or execute <code>host ouestfrance-ecole.com</code> I have a response cause the domain really exist and host a website.</p>

<p>What are the reasons ?</p>

<p>Thanks</p>
