diff --git a/site/features.md b/site/features.md index 0a5d297d..cc9d6126 100644 --- a/site/features.md +++ b/site/features.md @@ -296,13 +296,9 @@ returned. So now host2$ ping 10.2.1.132 will work, and, more interestingly, we can ping our `a1` application -container, which is residing on `$HOST1`, after finding its IP -address: +container, which is residing on `$HOST1`: - host1$ weave ps a1 - a1 1e:88:d7:5b:77:68 10.2.1.2/24 - - host2$ ping 10.2.1.2 + host2$ ping $(weave dns-lookup a1) Multiple subnet addresses can be exposed or hidden with a single invocation: @@ -337,11 +333,8 @@ explained [above](#host-network-integration), i.e. Then we add a NAT rule to route from the outside world to the destination container service. - host1$ weave ps a1 - a1 1e:88:d7:5b:77:68 10.2.1.2/24 - host2$ iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 2211 \ - -j DNAT --to-destination 10.2.1.2:4422 + -j DNAT --to-destination $(weave dns-lookup a1):4422 Here we are assuming that the "outside world" is connecting to `$HOST2` via 'eth0'. We want TCP traffic to port 2211 on the external IPs to be diff --git a/site/weavedns.md b/site/weavedns.md index 1166b00e..5e9d261e 100644 --- a/site/weavedns.md +++ b/site/weavedns.md @@ -16,6 +16,7 @@ hosts. * [Load balancing](#load-balancing) * [Fault resilience](#fault-resilience) * [Adding and removing extra DNS entries](#add-remove) +* [Resolve weaveDNS entries from host](#resolve-weavedns-entries-from-host) * [Hot-swapping service containers](#hot-swapping) * [Retaining DNS entries when containers stop](#retain-stopped) * [Configuring a custom TTL](#ttl) @@ -133,7 +134,6 @@ one of the `pingme` containers and re-run the ping tests, eventually [cache expiry time](#ttl)) we will only be hitting the address of the container that is still alive. - ## Adding and removing extra DNS entries If you want to give the container a name in DNS *other* than its @@ -157,6 +157,14 @@ $ weave dns-remove 10.2.1.27 $C When queried about a name with multiple IPs, weaveDNS returns all IPs available in a random order. +## Resolve weaveDNS entries from host + +You can resolve entries from any host running weaveDNS with `weave +dns-lookup`: + + host1$ weave dns-lookup pingme + 10.40.0.1 + ## Hot-swapping service containers If you would like to deploy a new version of a service, keep the old