Bryan Boreham
a5ddb63fca
Remove Info.Print in favour of Log.Info
2015-07-01 14:01:45 +01:00
Bryan Boreham
d82578d895
Replace logging calls with new style
2015-07-01 12:26:23 +01:00
Bryan Boreham
9636675c2c
Split part of DNSServer.Start() to a separate ActivateAndServe()
...
Specifically, move the part that blocks, and call that as necessary.
This means Start() can run on the caller's goroutine and avoid race conditions.
2015-06-17 11:35:53 +01:00
Alvaro Saurin
d086867c0c
make negative TTL default to same value as TTL
2015-06-17 10:17:12 +02:00
Paul Bellamy
96bda1639e
define weavedns http port as a constant
2015-06-11 10:27:35 +01:00
Alvaro Saurin
858a6dd253
Make the TTL returned for local answers configurable.
2015-05-29 12:50:18 +02:00
Alvaro Saurin
6d2317d60e
Silence "golint" errors
...
Silence "go vet" errors
Run goimports
2015-05-28 10:05:22 +02:00
Alvaro Saurin
32627eccbf
Fix the timeout for the fallback server client connection
2015-05-28 09:12:53 +02:00
Alvaro Saurin
954c5cb394
Limit the number of answers we provide to users.
2015-05-27 14:54:29 +02:00
Alvaro Saurin
c4b07fd44e
Shuffle all the replies, not only the ones from the cache...
2015-05-26 21:24:28 +02:00
Alvaro Saurin
5fe0a7fbb2
Make Stop() idempotent
2015-05-26 21:20:44 +02:00
Alvaro Saurin
07d15092aa
Do not invoke the mDNS lookups from the server: they are used from the Zone database now...
...
Improved DNS server:
- simplify the handlers code, removing duplicated code
- more configuration parameters (eg, we can now disable the cache)
- we can now bind to port 0 and let the server get a free port (so we can get rid of the mess we had in the unit tests...)
2015-05-26 21:20:42 +02:00
Alvaro Saurin
da2d66a6df
New zone database
2015-05-26 21:14:06 +02:00
Alvaro Saurin
c1d124df4c
Interfaces for the mDNS client and server
2015-05-26 21:11:34 +02:00
Matthias Radestock
52a89a318a
cosmetic: resolve yet more linter complaints
2015-05-11 02:44:15 +01:00
Alvaro Saurin
ba98135e03
Return NOTIMP for some unimplemented query types, NXDOMAIN otherwise
2015-05-05 21:31:11 +02:00
Alvaro Saurin
d7c154ea41
Removed the "now" parameters and use an external clock provider
2015-04-28 12:02:49 +02:00
Matthias Radestock
ce4c79ed93
refactor: extract commonQueryHandler
...
to remove duplication between queryHandler and rdnsHandler
2015-04-26 12:40:34 +01:00
Matthias Radestock
cb42ec358e
even more alignment between queryHandler and rdnsHandler
...
in preparation of extracting common helper function
2015-04-26 11:40:28 +01:00
Matthias Radestock
1a35b5aa2b
align queryHandler and rdnsHandler
...
increasing their similarity in preparation of refactor
2015-04-26 11:20:44 +01:00
Alvaro Saurin
58c8945b32
Support "insistent" queries in the mDNS client, used for obtaining all possible responses from mDNS servers.
...
Support for multiple responses from Lookup*() methods
Support for multiple records when building packets with make*() methods
Use a common "ZoneRecord" interface for structs that contain names and IPs
2015-04-23 13:01:29 +02:00
Tom Wilkie
f735082d95
Fix gofmt errors in nameserver.
2015-04-17 11:42:29 +00:00
Adam Harrison
7f434d71e1
Merge pull request #532 from inercia/weave-225-fix-2
...
Fix in WeaveDNS: do not modify cache when getting a reply
2015-04-13 14:20:40 +01:00
Adam Harrison
29b3b91423
Merge pull request #501 from inercia/weave-225-fix-1
...
Fix for negative TTLs in WeaveDNS
2015-04-13 14:19:47 +01:00
Alvaro Saurin
7811e2b470
Improved log messages
2015-04-09 16:19:05 +02:00
Alvaro Saurin
5d5b101707
Set locally resolved queries as Authoritative
2015-04-09 16:19:05 +02:00
Alvaro Saurin
186481052d
Catch unsupported queries by using the cache
2015-04-09 16:18:55 +02:00
Alvaro Saurin
6f545a4296
Fix for negative TTLs by using a different lookups set depending on the value stored in the cache.
2015-04-09 16:17:19 +02:00
Bryan Boreham
8a82f368d0
Update repository name from zettio to weaveworks
2015-04-08 16:35:52 +01:00
Matthias Radestock
10f37db9da
tidy up DNSServer fields
...
- make Zone, Iface and Upstream public - this is safe and makes sense
since all are immutable, and the former two are passed to the
constructor and are thus known anyway, and the latter is derived
from external information
- remove IfaceName - we can just use Iface instead
- log Upstream on startup
2015-03-31 12:04:31 +01:00
Matthias Radestock
2500bc210a
cosmetic: more linting
2015-03-27 01:21:36 +00:00
Matthias Radestock
1ad950f177
cosmetic: more linting
2015-03-27 01:12:16 +00:00
Matthias Radestock
45740b1419
refactor: replace buf.WriteString(fmt.S*(...)) with fmt.F*(&buf,...)
...
shorter and more efficient
2015-03-26 14:20:28 +00:00
Alvaro Saurin
9dcec8ca16
basic DNS cache
...
unit tests
2015-03-24 12:44:01 +01:00
Adam Harrison
c36543a247
Include DNS server config in status
2015-03-17 15:41:01 +00:00
David Wragg
cda6b8d582
Fix a few deviations from go fmt
2015-03-05 13:56:21 +00:00
Alvaro Saurin
4682f7ed95
zettio/weave#366 - removed reference to DNSServerConfig in the DNSServer struct
2015-02-27 15:40:32 +01:00
Alvaro Saurin
007873a402
zettio/weave#366 - keep the DNSServerConfig inmutable
2015-02-27 12:22:08 +01:00
Alvaro Saurin
0bc3e333f8
zettio/weave#366 - minor: fixed a typo and removed some superfluous code
2015-02-26 10:51:48 +01:00
Alvaro Saurin
403520f4b6
zettio/weave#366 - move more initialization code to the constructor
2015-02-26 10:51:48 +01:00
Alvaro Saurin
bbd69170f9
zettio/weave#366 - improved configuration for th DNSServer, where we can specify the local domain name among other things... (missing some unit tests for this customized local domain)
2015-02-26 10:51:48 +01:00
Alvaro Saurin
419138ec6a
zettio/weave#362 - use a WaitGroup for the TCP/UDP goroutines: otherwise, WeaveDNS server just quits
2015-02-23 13:17:54 +01:00
Alvaro Saurin
3de924fa2f
zettio/weave#362 - moved Check*() to common
2015-02-23 13:17:54 +01:00
Alvaro Saurin
5dd475b2e5
zettio/weave#362 - fix DNSServer initialization
...
removed a couple of goroutines spawns...
2015-02-23 13:17:54 +01:00
Alvaro Saurin
ef72d65aa4
zettio/weave#362 - use for fallback queries the same protocol clients have used for querying us.
2015-02-23 13:17:54 +01:00
Alvaro Saurin
9c7ffd9b81
zettio/weave#362 - improve the unit tests for the TCP server by checking if we get all the responses with TCP when a previous UDP query resulted in a truncated response.
2015-02-23 13:17:54 +01:00
Alvaro Saurin
c81769cc9a
zettio/weave#362 - implement a graceful shutdown
2015-02-23 13:17:54 +01:00
Alvaro Saurin
c1f9c8bc10
zettio/weave#362 - new constructor for creating a DNS server with a given config
...
fix unit tests by using the new constructor
2015-02-23 13:17:54 +01:00
Alvaro Saurin
3be5600383
zettio/weave#362 - reorganize the DNS server code, so it looks like the mDNS server, with a proper class with Start() and so...
...
Listen on TCP on port 53 by default
2015-02-23 13:17:54 +01:00
Michael Bridgen
1f9e321097
Merge branch '360_dns_buffer' of https://github.com/bboreham/weave into pr361
2015-02-04 16:35:14 +00:00