# Use addresses from the local network interfaces (inluding loopback, but also others)
USE_LOCALADDR = YES
+# Use address obtained from a DNS lookup of our hostname
+USE_HOSTNAME = NO
+
# External IP address of the NAT box (if known); IPv4 dotted-decimal ONLY at this time (should allow DynDNS!)
# normal interface IP address for non-NATed peers;
# possibly auto-detected (using UPnP) if possible if not specified
*/
int use_localaddresses;
+ /**
+ * Should we do a DNS lookup of our hostname to find out our own IP?
+ */
+ int use_hostname;
+
/**
* Is using IPv6 disabled?
*/
h->use_localaddresses = GNUNET_CONFIGURATION_get_value_yesno (cfg,
"nat",
"USE_LOCALADDR");
+ h->use_hostname = GNUNET_CONFIGURATION_get_value_yesno (cfg,
+ "nat",
+ "USE_HOSTNAME");
if (h->use_localaddresses)
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "USE LOCALADDR enabled!\n");
h->disable_ipv6 = GNUNET_CONFIGURATION_get_value_yesno(cfg,
if (NULL != h->address_callback)
{
- h->ifc_task = GNUNET_SCHEDULER_add_now (&list_interfaces, h);
- h->hostname_task = GNUNET_SCHEDULER_add_now (&resolve_hostname, h);
+ h->ifc_task = GNUNET_SCHEDULER_add_now (&list_interfaces, h);
+ if (GNUNET_YES == h->use_hostname)
+ h->hostname_task = GNUNET_SCHEDULER_add_now (&resolve_hostname, h);
}
return h;
}