title: Create socket when have DNS name
body: <p>Bellow is peace of code that I use to connect to socket in Windows. Sometimes I don't have IP dress, but have DNS name in <code>inetAddr</code>. Probably I must resolve address from host name, or it is possible create socket with <code>DNS</code> name? What is the best way to create socket when have <code>DNS</code> name? </p>
  
  <pre><code>commStatus communicate( const char * tx, char * rx, const int bufSize , const char * inetAddr, const int port )
  {
  ...
          SOCKET s;
          struct sockaddr_in server;
  
  
          server.sin_addr.s_addr = inet_addr(inetAddr);
          server.sin_family = AF_INET;
          server.sin_port = htons( port );
  
          if((s = socket(AF_INET , SOCK_STREAM , 0 )) == INVALID_SOCKET)
          {
  
              FILELOGL("Could not create socket : " &lt;&lt; WSAGetLastError(),Level::Error );
  
          } else
          {
              if (connect(s , (struct sockaddr *)&amp;server , sizeof(server)) &lt; 0)
              {
                  FILELOGL("connect error", Level::Error);
                  r= commStatus::COMM_NO_TRANSMIT ;
              } else
              {
              ...
              }
          }
  ...
  }
  </code></pre>