Does bind read /etc/hosts?
Dear sir/madam, Before Bind consults authority NS, does it access /etc/hosts? In my testing, it does not even seem to access /etc/hosts. But someone tells me Bind can access /etc/hosts first. Can you pls tell me how to config Bind to access /etc/hosts fist? Thanks, Guanghua ___ Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list bind-users mailing list bind-users@lists.isc.org https://lists.isc.org/mailman/listinfo/bind-users
Re: Does bind read /etc/hosts?
In message bay173-w11d824e324939a1bb89852bb...@phx.gbl, houguanghua writes: Dear sir/madam, Before Bind consults authority NS, does it access /etc/hosts? In my testing, it does not even seem to access /etc/hosts. But someone tells me Bind can access /etc/hosts first. Can you pls tell me how to config Bind to access /etc/hosts fist? Thanks, Guanghua No. getaddrinfo, gethostbyname etc. however may access /etc/hosts, NIS, mDNS, DNS and other databases. You need to read the documentation that comes with your system for how to control these. Mark -- Mark Andrews, ISC 1 Seymour St., Dundas Valley, NSW 2117, Australia PHONE: +61 2 9871 4742 INTERNET: ma...@isc.org ___ Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list bind-users mailing list bind-users@lists.isc.org https://lists.isc.org/mailman/listinfo/bind-users
Re: Does bind read /etc/hosts?
At Tue, 15 Jul 2014 10:28:30 +, houguanghua wrote: Before Bind consults authority NS, does it access /etc/hosts? In my testing, it does not even seem to access /etc/hosts. That's right. BIND tools (dig, ...) are DNS tools. Local files aren't part of the DNS. For more information, please see http://serverfault.com/questions/498500/why-does-the-host-command-not-resolve-entries-in-etc-hosts Best regards, Niall O'Reilly ___ Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list bind-users mailing list bind-users@lists.isc.org https://lists.isc.org/mailman/listinfo/bind-users
RE: Does bind read /etc/hosts?
The confusion can come in because some UNIX variants (notably HP-UX) nslookup was modified to honor /etc/nsswitch.conf so it DOES check /etc/hosts if files precedes dns. However, in most things (e.g. Linux, Solaris) nslookup (and the newer host command) do not look at /etc/hosts regardless of nsswitch.conf setting. -Original Message- From: bind-users-boun...@lists.isc.org [mailto:bind-users-boun...@lists.isc.org] On Behalf Of Niall O'Reilly Sent: Tuesday, July 15, 2014 6:57 AM To: houguanghua Cc: bind-users@lists.isc.org Subject: Re: Does bind read /etc/hosts? At Tue, 15 Jul 2014 10:28:30 +, houguanghua wrote: Before Bind consults authority NS, does it access /etc/hosts? In my testing, it does not even seem to access /etc/hosts. That's right. BIND tools (dig, ...) are DNS tools. Local files aren't part of the DNS. For more information, please see http://serverfault.com/questions/498500/why-does-the-host-command-not-resolve-entries-in-etc-hosts Best regards, Niall O'Reilly ___ Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list bind-users mailing list bind-users@lists.isc.org https://lists.isc.org/mailman/listinfo/bind-users Athena(r), Created for the Cause(tm) Making a Difference in the Fight Against Breast Cancer __ CONFIDENTIALITY NOTICE: This e-mail may contain privileged or confidential information and is for the sole use of the intended recipient(s). If you are not the intended recipient, any disclosure, copying, distribution, or use of the contents of this information is prohibited and may be unlawful. If you have received this electronic transmission in error, please reply immediately to the sender that you have received the message in error, and delete it. Thank you ___ Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list bind-users mailing list bind-users@lists.isc.org https://lists.isc.org/mailman/listinfo/bind-users
RE: Does bind read /etc/hosts?
Sorry for what I said isn't very clear. I did know when the /etc/hosts is accessed in the OS. What I want to know is whether the named access the hosts file. The /etc/hosts file isn't in the client's system, but in the system of Local DNS server where the 'named' task runs. For example: In the /etc/hosts file of Local DNS server(LDNS), one line exists as follows: 10.10.10.1 www.google.com A client querys this LDNS to get the IP of 'www.google.com' (the client may use dig,nslookup command. No host line is configured in /etc/hosts of this client ), what IP will be returned to the client? Can the LDNS return 10.10.10.1 defined in the /etc/hosts to the client? maybe some special configuration in named can support this feature. Thanks, Guanghua To: houguang...@hotmail.com CC: bind-us...@isc.org From: ma...@isc.org Subject: Re: Does bind read /etc/hosts? Date: Tue, 15 Jul 2014 20:38:12 +1000 In message bay173-w11d824e324939a1bb89852bb...@phx.gbl, houguanghua writes: Dear sir/madam, Before Bind consults authority NS, does it access /etc/hosts? In my testing, it does not even seem to access /etc/hosts. But someone tells me Bind can access /etc/hosts first. Can you pls tell me how to config Bind to access /etc/hosts fist? Thanks, Guanghua No. getaddrinfo, gethostbyname etc. however may access /etc/hosts, NIS, mDNS, DNS and other databases. You need to read the documentation that comes with your system for how to control these. Mark -- Mark Andrews, ISC 1 Seymour St., Dundas Valley, NSW 2117, Australia PHONE: +61 2 9871 4742 INTERNET: ma...@isc.org ___ Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list bind-users mailing list bind-users@lists.isc.org https://lists.isc.org/mailman/listinfo/bind-users
Re: Does bind read /etc/hosts?
In message bay173-w26f0d751d9e56ffda14b15bb...@phx.gbl, houguanghua writes: Sorry for what I said isn't very clear. I did know when the /etc/hosts is accessed in the OS. What I want to know is whether the named access the hosts file. And I gave you a clear, unequivicable No. Named does not read /etc/hosts. Mark The /etc/hosts file isn't in the client's system, but in the system of Local DNS server where the 'named' task runs. For example: In the /etc/hosts file of Local DNS server(LDNS), one line exists as follows: 10.10.10.1 www.google.com A client querys this LDNS to get the IP of 'www.google.com' (the client may use dig,nslookup command. No host line is configured in /etc/hosts of this client ), what IP will be returned to the client? Can the LDNS return 10.10.10.1 defined in the /etc/hosts to the client? maybe some special configuration in named can support this feature. Thanks, Guanghua To: houguang...@hotmail.com CC: bind-us...@isc.org From: ma...@isc.org Subject: Re: Does bind read /etc/hosts? Date: Tue, 15 Jul 2014 20:38:12 +1000 In message bay173-w11d824e324939a1bb89852bb...@phx.gbl, houguanghua writes: Dear sir/madam, Before Bind consults authority NS, does it access /etc/hosts? In my testing, it does not even seem to access /etc/hosts. But someone tells me Bind can access /etc/hosts first. Can you pls tell me how to config Bind to access /etc/hosts fist? Thanks, Guanghua No. getaddrinfo, gethostbyname etc. however may access /etc/hosts, NIS, mDNS, DNS and other databases. You need to read the documentation that comes with your system for how to control these. Mark -- Mark Andrews, ISC 1 Seymour St., Dundas Valley, NSW 2117, Australia PHONE: +61 2 9871 4742 INTERNET: ma...@isc.org -- Mark Andrews, ISC 1 Seymour St., Dundas Valley, NSW 2117, Australia PHONE: +61 2 9871 4742 INTERNET: ma...@isc.org ___ Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list bind-users mailing list bind-users@lists.isc.org https://lists.isc.org/mailman/listinfo/bind-users
RE: Does bind read /etc/hosts?
Thanks a lot. To: houguang...@hotmail.com CC: bind-us...@isc.org From: ma...@isc.org Subject: Re: Does bind read /etc/hosts? Date: Wed, 16 Jul 2014 11:33:00 +1000 In message bay173-w26f0d751d9e56ffda14b15bb...@phx.gbl, houguanghua writes: Sorry for what I said isn't very clear. I did know when the /etc/hosts is accessed in the OS. What I want to know is whether the named access the hosts file. And I gave you a clear, unequivicable No. Named does not read /etc/hosts. Mark The /etc/hosts file isn't in the client's system, but in the system of Local DNS server where the 'named' task runs. For example: In the /etc/hosts file of Local DNS server(LDNS), one line exists as follows: 10.10.10.1 www.google.com A client querys this LDNS to get the IP of 'www.google.com' (the client may use dig,nslookup command. No host line is configured in /etc/hosts of this client ), what IP will be returned to the client? Can the LDNS return 10.10.10.1 defined in the /etc/hosts to the client? maybe some special configuration in named can support this feature. Thanks, Guanghua To: houguang...@hotmail.com CC: bind-us...@isc.org From: ma...@isc.org Subject: Re: Does bind read /etc/hosts? Date: Tue, 15 Jul 2014 20:38:12 +1000 In message bay173-w11d824e324939a1bb89852bb...@phx.gbl, houguanghua writes: Dear sir/madam, Before Bind consults authority NS, does it access /etc/hosts? In my testing, it does not even seem to access /etc/hosts. But someone tells me Bind can access /etc/hosts first. Can you pls tell me how to config Bind to access /etc/hosts fist? Thanks, Guanghua No. getaddrinfo, gethostbyname etc. however may access /etc/hosts, NIS, mDNS, DNS and other databases. You need to read the documentation that comes with your system for how to control these. Mark -- Mark Andrews, ISC 1 Seymour St., Dundas Valley, NSW 2117, Australia PHONE: +61 2 9871 4742 INTERNET: ma...@isc.org -- Mark Andrews, ISC 1 Seymour St., Dundas Valley, NSW 2117, Australia PHONE: +61 2 9871 4742 INTERNET: ma...@isc.org ___ Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list bind-users mailing list bind-users@lists.isc.org https://lists.isc.org/mailman/listinfo/bind-users
Re: Does bind read /etc/hosts?
What I want to know is whether the named access the hosts file. I wonder if the OP is actually asking for a way to have BIND return specific values for specific host names, without having them looked up in the real DNS. Guanghua, can you tell us the result you wish to achieve? From your example, it looks as if you are trying to get BIND to return a value of your choice, rather than the value that would normally be returned by a DNS lookup. Regards, K. -- ~~~ Karl Auer (ka...@biplane.com.au) http://www.biplane.com.au/kauer http://twitter.com/kauer389 GPG fingerprint: EC67 61E2 C2F6 EB55 884B E129 072B 0AF0 72AA 9882 Old fingerprint: B862 FB15 FE96 4961 BC62 1A40 6239 1208 9865 5F9A ___ Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list bind-users mailing list bind-users@lists.isc.org https://lists.isc.org/mailman/listinfo/bind-users
Re: Does bind read /etc/hosts?
Am 16.07.2014 03:27, schrieb houguanghua: Sorry for what I said isn't very clear you wheer clear I did know when the /etc/hosts is accessed in the OS agreed What I want to know is whether the named access the hosts file The /etc/hosts file isn't in the client's system, for bind applies the same as for bind-utils (dig, nslookup...) anything else would be strange and unpredictable behavior but in the system of Local DNS server where the 'named' task runs. For example: In the /etc/hosts file of Local DNS server(LDNS), one line exists as follows: 10.10.10.1 www.google.com bind don't care about that A client querys this LDNS to get the IP of 'www.google.com' (the client may use dig,nslookup command. No host line is configured in /etc/hosts of this client ), what IP will be returned to the client? the one of the DNS system Can the LDNS return 10.10.10.1 defined in the /etc/hosts to the client? maybe some special configuration in named can support this feature wrong tool - dnsmasq can but on the other hand has no bind-like zonefiles signature.asc Description: OpenPGP digital signature ___ Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list bind-users mailing list bind-users@lists.isc.org https://lists.isc.org/mailman/listinfo/bind-users
Re: Does bind read /etc/hosts?
In message 53c5e714.5080...@thelounge.net, Reindl Harald writes: Can the LDNS return 10.10.10.1 defined in the /etc/hosts to the client? maybe some special configuration in named can support this feature wrong tool - dnsmasq can but on the other hand has no bind-like zonefiles Neither dnsmasq nor named read /etc/hosts. Both can be used to override data from outside. They just have different configuration methods. Mark -- Mark Andrews, ISC 1 Seymour St., Dundas Valley, NSW 2117, Australia PHONE: +61 2 9871 4742 INTERNET: ma...@isc.org ___ Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list bind-users mailing list bind-users@lists.isc.org https://lists.isc.org/mailman/listinfo/bind-users
Re: Does bind read /etc/hosts?
On Wed, Jul 16, 2014 at 9:55 AM, Mark Andrews ma...@isc.org wrote: In message 53c5e714.5080...@thelounge.net, Reindl Harald writes: Can the LDNS return 10.10.10.1 defined in the /etc/hosts to the client? maybe some special configuration in named can support this feature wrong tool - dnsmasq can but on the other hand has no bind-like zonefiles Neither dnsmasq nor named read /etc/hosts. From dnsmasq man page: ... It loads the contents of /etc/hosts so that local hostnames which do not appear in the global DNS can be resolved and also answers DNS queries for DHCP configured hosts So dnsmasq does read /etc/hosts. Or did you mean something else? -- Fajar ___ Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list bind-users mailing list bind-users@lists.isc.org https://lists.isc.org/mailman/listinfo/bind-users
Re: Does bind read /etc/hosts?
Am 16.07.2014 04:55, schrieb Mark Andrews: In message 53c5e714.5080...@thelounge.net, Reindl Harald writes: Can the LDNS return 10.10.10.1 defined in the /etc/hosts to the client? maybe some special configuration in named can support this feature wrong tool - dnsmasq can but on the other hand has no bind-like zonefiles Neither dnsmasq nor named read /etc/hosts. Both can be used to override data from outside. They just have different configuration methods surely, otherwise --no-hosts or the config param to disable that would not make sense, using it with ATS in production [root@localhost:~]$ dnsmasq --help | grep no-hosts -h, --no-hosts Do NOT load /etc/hosts file. -H, --addn-hosts=file Additional hosts file. Read the specified file as well as /etc/hosts. If -h is given, read only the specified file. This option may be repeated for more than one additional hosts file. If a directory is given, then read all the files contained in that directory. [root@localhost:~]$ cat /etc/dnsmasq.conf resolv-file=/etc/resolv.conf.dnsmasq strict-order user=nobody group=nobody interface=lo no-dhcp-interface=lo bind-interfaces no-hosts addn-hosts=/etc/hosts.dnsmasq local-ttl=3600 signature.asc Description: OpenPGP digital signature ___ Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list bind-users mailing list bind-users@lists.isc.org https://lists.isc.org/mailman/listinfo/bind-users
Re: Does bind read /etc/hosts?
Ok, I stand corrected. That said both named and dnsmasq as well as other products can override data from outside. -- Mark Andrews, ISC 1 Seymour St., Dundas Valley, NSW 2117, Australia PHONE: +61 2 9871 4742 INTERNET: ma...@isc.org ___ Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list bind-users mailing list bind-users@lists.isc.org https://lists.isc.org/mailman/listinfo/bind-users