-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
87 lines (56 loc) · 1.92 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
mdns-announce
=============
This is a tool that will use mDNS (Bonjour) to advertise a CNAME record.
For developing web applications, it can be handy to have the ability to create
various fake DNS entries that can be used with virtual hosting.
This was mainly developed to help build github.com/usingnamespace which uses
virtual hosting to differentiate between different blogs.
Requirements for building
-------------------------
You will need the following dependencies installed:
Mac OS X:
- Compiler with C++11 support (clang is default)
- libev
brew install libev
Other:
- Compiler with C++11 support
- libev
- dns_sd (Avahi or other)
Building
--------
./waf configure
./waf build_release
If you want to build using GCC (the build defaults to clang):
./waf configure --compiler=gcc
./waf build_release
Running
-------
./build/release/src/mdns-announce test.domains
Now if you open a new terminal in the same directory, you can run the following
to see that they are being announced as set in the file.
for I in `cat test.domains | awk -F : '{ print $1 }'`; do
dig @224.0.0.251 -p 5353 -t CNAME $I | grep CNAME | grep -v ";"
done
File Format
-----------
The file format is very simple:
<local domain>:<cname pointer>
For example:
com.example.local:example.com
net.example.local:example.net
If you want to allow the file to easily be transferred from system to system
(such as when working on an application with others, you can use $self to refer
to the current system).
$self will get replaced with the current systems hostname as returned by
gethostname(3).
test.local:$self
www.test.local:$self
Developing
----------
- Fork the project.
- Make your feature addition or bug fix.
- Commit
- Send me a pull request. Bonus points for topic branches.
Debug builds can be created like this:
./waf build
This will drop a debug binary in ./build/debug/src/mdns-announce.