Permalink
Browse files

Upgrading `installing` and `settings` sections in README.

  • Loading branch information...
nuxlli committed Aug 21, 2014
1 parent e1deb5e commit 725f2e8dc1e9f1bdbfdc2477e830b58d641eb7af
Showing with 46 additions and 17 deletions.
  1. +42 −13 README.md
  2. +4 −4 SConstruct
View
@@ -1,6 +1,6 @@
# libnss-resolver
A Linux extension that adds support the `/etc/resolver/*`,a means to support different "nameserver"
A Linux extension that adds support the `/etc/resolver/*`, a means to support different "nameserver"
to specific suffixes, in a similar fashion to that which is supported on Mac OS X.
This is still a work in progress!
@@ -9,7 +9,7 @@ This is still a work in progress!
### From package
Coming soon...
Download and install the appropriate package for your Linux distribution [here](https://github.com/azukiapp/libnss-resolver/releases).
### From the source
@@ -20,15 +20,19 @@ And after that:
```bash
$ git clone https://github.com/azukiapp-samples/libnss-resolver
$ cd libnss-resolver
# build
$ azk shell build -t -c "scons"
# [so] options: ubuntu12, ubuntu14, fedora20
$ azk shell [so]
# Run tests
# run tests
$ azk start dns # Run a mock dns server to test
$ azk shell build -t -c "./build/test"
$ azk shell [so] -t -c "scons run-test"
# or debug
$ azk shell [so] -t -c "scons run-test -Q define=DEBUG"
# Install local
$ azk shell --mount /usr/lib:/azk/lib -c "scons install"
# install local
$ azk shell [so] --mount /usr/lib:/azk/lib -c "scons install"
```
Now you can add the resolver-nss in resolution pipe:
@@ -40,12 +44,36 @@ $ sudo sed -i -re 's/^(hosts: .*$)/\1 resolver/' /etc/nsswitch.conf
or edit `/etc/nsswitch.conf`:
```bash
# Normally
# normally
hosts: files dns resolver
# But, if you have avahi (Zeroconf) installed ↓
# but, if you have avahi (Zeroconf) installed ↓
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 resolver
```
## Configuring
After install you can create a `sufix` zones in `/etc/resolver/`, like this:
```bash
$ echo "nameserver 127.0.0.1:5353" | sudo tee -a /etc/resolver/test.dev
```
A good way to test is to install dnsmasq:
```bash
$ sudo yum install dnsmasq
$ dnsmaqs -p 5353 --no-daemon --address=/test.dev/127.0.0.1
```
Now you can try this:
```bash
$ ping sufix
$ ping test.dev
# or any "subdomain"
$ ping any.test.dev
```
## Test and build
This project uses clang to compile, scons as mounting and valgrind tool to analyze code and running.
@@ -54,17 +82,18 @@ But all these tools are available behind the [azk][azk], just the commands below
```bash
$ azk start dns
$ azk shell build
# [so] options: ubuntu12, ubuntu14, fedora20
$ azk shell [so] -t -c "scons local-install"
```
After that, the following scons targets are available:
```bash
# To build and run testes
# to build and run testes
$ scons run-test -Q [define=DEBUG] [valgrind="valgrind options"]
# To install in azk instance
# to install in azk instance
$ scons local-install
# And test with:
# and test with:
$ ping resolver.dev
```
View
@@ -85,10 +85,10 @@ for k,v in install_dirs.items():
globals()['so_' + k] = build
# Test
env['ENV']['TEST_DNS_PORT'] = os.environ['DNS_DNS_PORT']
env['ENV']['TEST_DNS_HOST'] = os.environ['DNS_DNS_HOST']
env['ENV']['TEST_DNS_IP'] = os.environ['DNS_IP']
env['ENV']['TEST_DOMAIN'] = os.environ['DNS_DOMAIN']
env['ENV']['TEST_DNS_PORT'] = os.environ.get('DNS_DNS_PORT', None)
env['ENV']['TEST_DNS_HOST'] = os.environ.get('DNS_DNS_HOST', None)
env['ENV']['TEST_DNS_IP'] = os.environ.get('DNS_IP', None)
env['ENV']['TEST_DOMAIN'] = os.environ.get('DNS_DOMAIN', None)
env['ENV']['TEST_FIXTURES'] = os.getcwd() + '/test/fixtures/'
env['ENV']['VALGRIND_OPTS'] = ARGUMENTS.get('valgrind', '')
env['ENV']['LD_LIBRARY_PATH'] = '/usr/local/lib'

0 comments on commit 725f2e8

Please sign in to comment.