1*48a54d36SAndroid Build Coastguard Worker# Readme for libnss_mdns 2*48a54d36SAndroid Build Coastguard Worker 3*48a54d36SAndroid Build Coastguard WorkerAndrew White <[email protected]> 4*48a54d36SAndroid Build Coastguard WorkerJune 2004 5*48a54d36SAndroid Build Coastguard Worker 6*48a54d36SAndroid Build Coastguard WorkerBefore using this software, see "Licensing" at bottom of this file. 7*48a54d36SAndroid Build Coastguard Worker 8*48a54d36SAndroid Build Coastguard Worker 9*48a54d36SAndroid Build Coastguard Worker# Introduction 10*48a54d36SAndroid Build Coastguard Worker 11*48a54d36SAndroid Build Coastguard WorkerThis code implements a module for the Name Service Switch to perform 12*48a54d36SAndroid Build Coastguard Workerhostname lookups using the Darwin mDNSResponder / mdnsd. This code has 13*48a54d36SAndroid Build Coastguard Workerbeen tested on Debian and Redhat Linux. It may work on other platforms. 14*48a54d36SAndroid Build Coastguard WorkerIt *will not* work on Darwin or Mac OS X - the necessary functionality is 15*48a54d36SAndroid Build Coastguard Workeralready built into the operation system. 16*48a54d36SAndroid Build Coastguard Worker 17*48a54d36SAndroid Build Coastguard Worker 18*48a54d36SAndroid Build Coastguard Worker# Building and Installing: 19*48a54d36SAndroid Build Coastguard Worker 20*48a54d36SAndroid Build Coastguard WorkerSee "ReadMe.txt" for instructions on building and installing. 21*48a54d36SAndroid Build Coastguard Worker 22*48a54d36SAndroid Build Coastguard WorkerWhen you run "make install" as described in that file: 23*48a54d36SAndroid Build Coastguard Workero libnss_mdns-0.2.so and libnss_mdns.so.2 are installed in /lib, 24*48a54d36SAndroid Build Coastguard Workero manual pages libnss_mdns(8) and nss_mdns.conf(5) are installed, 25*48a54d36SAndroid Build Coastguard Workero nss_mdns.conf is installed in /etc, and 26*48a54d36SAndroid Build Coastguard Workero /etc/nsswitch.conf is modified to add "mdns" on the "hosts:" line 27*48a54d36SAndroid Build Coastguard Worker 28*48a54d36SAndroid Build Coastguard WorkerThis will cause dns lookups to be passed via mdnsd before trying the dns. 29*48a54d36SAndroid Build Coastguard Worker 30*48a54d36SAndroid Build Coastguard Worker 31*48a54d36SAndroid Build Coastguard Worker# Testing 32*48a54d36SAndroid Build Coastguard Worker 33*48a54d36SAndroid Build Coastguard WorkerFor most purposes, 'ping myhostname.local' will tell you if mdns is 34*48a54d36SAndroid Build Coastguard Workerworking. If MDNS_VERBOSE was set in nss_mdns.c during compilation then 35*48a54d36SAndroid Build Coastguard Workerlots of chatty debug messages will be dumped to LOG_DEBUG in syslog. 36*48a54d36SAndroid Build Coastguard WorkerOtherwise, nss_mdns will only log if something isn't behaving quite right. 37*48a54d36SAndroid Build Coastguard Worker 38*48a54d36SAndroid Build Coastguard Worker 39*48a54d36SAndroid Build Coastguard Worker# Implementation details 40*48a54d36SAndroid Build Coastguard Worker 41*48a54d36SAndroid Build Coastguard Workerlibnss_mdns provides alternative back-end implementations of the libc 42*48a54d36SAndroid Build Coastguard Workerfunctions gethostbyname, gethostbyname2 and gethostbyaddr, using the Name 43*48a54d36SAndroid Build Coastguard WorkerService Switch mechanism. More information on writing nsswitch modules 44*48a54d36SAndroid Build Coastguard Workercan be found via 'info libc "Name Service Switch"', if installed. 45*48a54d36SAndroid Build Coastguard Worker 46*48a54d36SAndroid Build Coastguard Worker 47*48a54d36SAndroid Build Coastguard Worker# Licensing 48*48a54d36SAndroid Build Coastguard Worker 49*48a54d36SAndroid Build Coastguard WorkerThis software is licensed under the NICTA Public Software License, version 50*48a54d36SAndroid Build Coastguard Worker1.0, printed below: 51*48a54d36SAndroid Build Coastguard Worker 52*48a54d36SAndroid Build Coastguard WorkerNICTA Public Software Licence 53*48a54d36SAndroid Build Coastguard WorkerVersion 1.0 54*48a54d36SAndroid Build Coastguard Worker 55*48a54d36SAndroid Build Coastguard WorkerCopyright © 2004 National ICT Australia Ltd 56*48a54d36SAndroid Build Coastguard Worker 57*48a54d36SAndroid Build Coastguard WorkerAll rights reserved. 58*48a54d36SAndroid Build Coastguard Worker 59*48a54d36SAndroid Build Coastguard WorkerBy this licence, National ICT Australia Ltd (NICTA) grants permission, 60*48a54d36SAndroid Build Coastguard Workerfree of charge, to any person who obtains a copy of this software 61*48a54d36SAndroid Build Coastguard Workerand any associated documentation files ("the Software") to use and 62*48a54d36SAndroid Build Coastguard Workerdeal with the Software in source code and binary forms without 63*48a54d36SAndroid Build Coastguard Workerrestriction, with or without modification, and to permit persons 64*48a54d36SAndroid Build Coastguard Workerto whom the Software is furnished to do so, provided that the 65*48a54d36SAndroid Build Coastguard Workerfollowing conditions are met: 66*48a54d36SAndroid Build Coastguard Worker 67*48a54d36SAndroid Build Coastguard Worker- Redistributions of source code must retain the above copyright 68*48a54d36SAndroid Build Coastguard Worker notice, this list of conditions and the following disclaimers. 69*48a54d36SAndroid Build Coastguard Worker- Redistributions in binary form must reproduce the above copyright 70*48a54d36SAndroid Build Coastguard Worker notice, this list of conditions and the following disclaimers in 71*48a54d36SAndroid Build Coastguard Worker the documentation and/or other materials provided with the 72*48a54d36SAndroid Build Coastguard Worker distribution. 73*48a54d36SAndroid Build Coastguard Worker- The name of NICTA may not be used to endorse or promote products 74*48a54d36SAndroid Build Coastguard Worker derived from this Software without specific prior written permission. 75*48a54d36SAndroid Build Coastguard Worker 76*48a54d36SAndroid Build Coastguard WorkerEXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT 77*48a54d36SAndroid Build Coastguard WorkerPERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS" AND 78*48a54d36SAndroid Build Coastguard WorkerNICTA MAKES NO REPRESENTATIONS, WARRANTIES OR CONDITIONS OF ANY 79*48a54d36SAndroid Build Coastguard WorkerKIND, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY 80*48a54d36SAndroid Build Coastguard WorkerREPRESENTATIONS, WARRANTIES OR CONDITIONS REGARDING THE CONTENTS 81*48a54d36SAndroid Build Coastguard WorkerOR ACCURACY OF THE SOFTWARE, OR OF TITLE, MERCHANTABILITY, FITNESS 82*48a54d36SAndroid Build Coastguard WorkerFOR A PARTICULAR PURPOSE, NONINFRINGEMENT, THE ABSENCE OF LATENT 83*48a54d36SAndroid Build Coastguard WorkerOR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR 84*48a54d36SAndroid Build Coastguard WorkerNOT DISCOVERABLE. 85*48a54d36SAndroid Build Coastguard Worker 86*48a54d36SAndroid Build Coastguard WorkerTO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL 87*48a54d36SAndroid Build Coastguard WorkerNICTA BE LIABLE ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, 88*48a54d36SAndroid Build Coastguard WorkerNEGLIGENCE) FOR ANY LOSS OR DAMAGE WHATSOEVER, INCLUDING (WITHOUT 89*48a54d36SAndroid Build Coastguard WorkerLIMITATION) LOSS OF PRODUCTION OR OPERATION TIME, LOSS, DAMAGE OR 90*48a54d36SAndroid Build Coastguard WorkerCORRUPTION OF DATA OR RECORDS; OR LOSS OF ANTICIPATED SAVINGS, 91*48a54d36SAndroid Build Coastguard WorkerOPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR OTHER ECONOMIC LOSS; 92*48a54d36SAndroid Build Coastguard WorkerOR ANY SPECIAL, INCIDENTAL, INDIRECT, CONSEQUENTIAL, PUNITIVE OR 93*48a54d36SAndroid Build Coastguard WorkerEXEMPLARY DAMAGES ARISING OUT OF OR IN CONNECTION WITH THIS LICENCE, 94*48a54d36SAndroid Build Coastguard WorkerTHE SOFTWARE OR THE USE OF THE SOFTWARE, EVEN IF NICTA HAS BEEN 95*48a54d36SAndroid Build Coastguard WorkerADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 96*48a54d36SAndroid Build Coastguard Worker 97*48a54d36SAndroid Build Coastguard WorkerIf applicable legislation implies warranties or conditions, or 98*48a54d36SAndroid Build Coastguard Workerimposes obligations or liability on NICTA in respect of the Software 99*48a54d36SAndroid Build Coastguard Workerthat cannot be wholly or partly excluded, restricted or modified, 100*48a54d36SAndroid Build Coastguard WorkerNICTA's liability is limited, to the full extent permitted by the 101*48a54d36SAndroid Build Coastguard Workerapplicable legislation, at its option, to: 102*48a54d36SAndroid Build Coastguard Worker 103*48a54d36SAndroid Build Coastguard Workera. in the case of goods, any one or more of the following: 104*48a54d36SAndroid Build Coastguard Worker i. the replacement of the goods or the supply of equivalent goods; 105*48a54d36SAndroid Build Coastguard Worker ii. the repair of the goods; 106*48a54d36SAndroid Build Coastguard Worker iii. the payment of the cost of replacing the goods or of acquiring 107*48a54d36SAndroid Build Coastguard Worker equivalent goods; 108*48a54d36SAndroid Build Coastguard Worker iv. the payment of the cost of having the goods repaired; or 109*48a54d36SAndroid Build Coastguard Workerb. in the case of services: 110*48a54d36SAndroid Build Coastguard Worker i. the supplying of the services again; or 111*48a54d36SAndroid Build Coastguard Worker ii. the payment of the cost of having the services supplied 112*48a54d36SAndroid Build Coastguard Worker again. 113*48a54d36SAndroid Build Coastguard Worker 114*48a54d36SAndroid Build Coastguard Worker 115*48a54d36SAndroid Build Coastguard Worker# Links: 116*48a54d36SAndroid Build Coastguard Worker 117*48a54d36SAndroid Build Coastguard WorkerNICTA 118*48a54d36SAndroid Build Coastguard Worker http://www.nicta.com.au/ 119*48a54d36SAndroid Build Coastguard WorkerDarwin 120*48a54d36SAndroid Build Coastguard Worker http://developer.apple.com/darwin/ 121*48a54d36SAndroid Build Coastguard WorkerDNS service discovery and link-local 122*48a54d36SAndroid Build Coastguard Worker http://http://zeroconf.org/ 123*48a54d36SAndroid Build Coastguard Worker http://http://multicastdns.org/ 124*48a54d36SAndroid Build Coastguard Worker http://http://dns-sd.org/ 125*48a54d36SAndroid Build Coastguard Worker http://http://dotlocal.org/ 126