/**
- * Get local hostname
- *
- * @param
+ * Get local fully qualified domain name
+ * @return fqdn
*/
char *
-GNUNET_RESOLVER_local_hostname_get ( )
+GNUNET_RESOLVER_local_fqdn_get ( void )
{
-
+ struct hostent *host;
char hostname[GNUNET_OS_get_hostname_max_length() + 1];
}
#if DEBUG_RESOLVER
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- _("Resolving our hostname `%s'\n"), hostname);
+ _("Resolving our FQDN `%s'\n"), hostname);
#endif
- return GNUNET_strdup (hostname);
+ host = gethostbyname ( hostname );
+ if ( NULL == host)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ _("Could not resolve our FQDN : %s\n"),
+ hstrerror (h_errno));
+ return NULL;
+ }
+ return GNUNET_strdup (host->h_name);
}
/**