View previous topic :: View next topic |
Author |
Message |
gRRosminet n00b
Joined: 11 Feb 2006 Posts: 19
|
Posted: Tue May 16, 2006 10:53 am Post subject: BIND/NAMED and /etc/hosts |
|
|
Hi,
I've set up a bind server, following the wiki and the forum
on an other PC, I have set /etc/resolv.conf tu use this local DNS server instead of the ones proposed by my provider. the redirection works very well.
On my local network I have multiple machines (let's say A B C and D) and so each one has a /etc/hosts file to see each other by name.
What I would like to do is that my DNS server "shares it's /etc/hosts" file with others machines. How can I do to be able on machine B to execute a "ping D" without having the corresponding line into the B's /etc/hosts file ?
Thanks for your help
Last edited by gRRosminet on Wed Jul 26, 2006 9:23 am; edited 1 time in total |
|
Back to top |
|
|
Dizzutch Guru
Joined: 09 Nov 2004 Posts: 463 Location: Worcester, MA
|
Posted: Tue May 16, 2006 12:58 pm Post subject: |
|
|
That's what the BIND server does, you want to setup a zone for your own network. however, linux will take /etc/hosts over a DNS lookup, so when you verify your BIND zone works (using nslookup) you can get rid of the hosts in /etc/hosts. _________________ Help the confused! Adopt an unanswered post!
prepend [solved] to your post title when you feel your issue is resolved.
Worcester Judo |
|
Back to top |
|
|
gRRosminet n00b
Joined: 11 Feb 2006 Posts: 19
|
Posted: Wed Jul 26, 2006 9:21 am Post subject: |
|
|
I did switch to dnsmasq but it cannot handle more than 2 DNS servers so I'm trying to comme back to BIND/NAMED server.
It still don't work for me and I can't see why. Resolving a website works well (like www.gentoo.org) but resolving a local PC (ordi1 or ordi1.mynetwork) doesn't work
Copies of my files :
bind version : 9.2.4
/etc/resolv.conf
Code: | domain mynetwork
search mynetwork
# ISP's DNS
nameserver 193.252.19.4
nameserver 193.252.19.3 |
/etc/hosts
Code: | 127.0.0.1 loopback localhost localhost.infass
10.1.0.1 ordi1 ordi1.mynetwork
10.1.0.2 ordi2 ordi2.mynetwork
10.1.0.3 ordi3 ordi3.mynetwork
10.1.0.4 ordi4 ordi4.mynetwork |
/etc/named.conf
Code: | options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
listen-on { 127.0.0.1; 10.1.0.3; };
allow-recursion { 127.0.0.1; 10.1.0.0/24; };
};
zone "." IN {
type hint;
file "named.ca";
};
zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
notify no;
};
zone "127.in-addr.arpa" IN {
type master;
file "127.zone";
allow-update { none; };
notify no;
};
|
localhost.zone
Code: | $TTL 1W
@ IN SOA ns.localhost. root.localhost. (
15 ; Serial
3H ; Refresh
15M ; Retry
1W ; Expiry
1D ) ; Minimum
IN NS 127.0.0.1
localhost. IN A 127.0.0.1 |
127.zone
Code: | $ORIGIN 127.in-addr.arpa.
$TTL 1W
@ 1D IN SOA localhost. root.localhost. (
15 ; Serial
3H ; Refresh
15M ; Retry
1W ; Expiry
1D ) ; Minimum
1D IN NS localhost.
* 1D IN PTR localhost. |
|
|
Back to top |
|
|
Janne Pikkarainen Veteran
Joined: 29 Jul 2003 Posts: 1143 Location: Helsinki, Finland
|
Posted: Wed Jul 26, 2006 12:00 pm Post subject: |
|
|
gRRosminet wrote: |
/etc/resolv.conf
Code: | domain mynetwork
search mynetwork
# ISP's DNS
nameserver 193.252.19.4
nameserver 193.252.19.3 |
|
Put your own name server up there. Now you may have bind up and running, but it's no good if you don't tell your computer to use it for something... _________________ Yes, I'm the man. Now it's your turn to decide if I meant "Yes, I'm the male." or "Yes, I am the Unix Manual Page.". |
|
Back to top |
|
|
gRRosminet n00b
Joined: 11 Feb 2006 Posts: 19
|
Posted: Wed Jul 26, 2006 12:12 pm Post subject: |
|
|
/etc/resolv.conf
Code: | domain mynetwork
search mynetwork
# ISP's DNS
nameserver 193.252.19.4
nameserver 193.252.19.3
#local nameserver : ordi3
nameserver 10.1.0.3
|
Doesn't work too |
|
Back to top |
|
|
Janne Pikkarainen Veteran
Joined: 29 Jul 2003 Posts: 1143 Location: Helsinki, Finland
|
Posted: Wed Jul 26, 2006 12:16 pm Post subject: |
|
|
Put it as the first one on that nameserver list. And make sure you don't have a daemon called nscd running, it caches the queries and in situations like this can provide some false results. _________________ Yes, I'm the man. Now it's your turn to decide if I meant "Yes, I'm the male." or "Yes, I am the Unix Manual Page.". |
|
Back to top |
|
|
gRRosminet n00b
Joined: 11 Feb 2006 Posts: 19
|
Posted: Wed Jul 26, 2006 12:22 pm Post subject: |
|
|
I did it already, but the result is the whenever it is the first or the third
And there is no nscd daemon on my server, neither my client |
|
Back to top |
|
|
Janne Pikkarainen Veteran
Joined: 29 Jul 2003 Posts: 1143 Location: Helsinki, Finland
|
Posted: Wed Jul 26, 2006 12:31 pm Post subject: |
|
|
Ok. Are those bind zone files completely present here or did you copy-paste just the beginning of them? Because at the moment it seems your zone files are pretty empty without any actual information about your hosts. _________________ Yes, I'm the man. Now it's your turn to decide if I meant "Yes, I'm the male." or "Yes, I am the Unix Manual Page.". |
|
Back to top |
|
|
gRRosminet n00b
Joined: 11 Feb 2006 Posts: 19
|
|
Back to top |
|
|
gRRosminet n00b
Joined: 11 Feb 2006 Posts: 19
|
Posted: Thu Jul 27, 2006 8:39 am Post subject: |
|
|
any other idea ? |
|
Back to top |
|
|
Janne Pikkarainen Veteran
Joined: 29 Jul 2003 Posts: 1143 Location: Helsinki, Finland
|
Posted: Thu Jul 27, 2006 8:56 am Post subject: |
|
|
Please re-read the thread you posted above. It contains also the actual zone files filled with information about hosts. If you think of it, at the moment you don't have any host related lines in your bind config, so it has no way of knowing what (for example) 10.10.10.3 should translate to. That's my hint. _________________ Yes, I'm the man. Now it's your turn to decide if I meant "Yes, I'm the male." or "Yes, I am the Unix Manual Page.". |
|
Back to top |
|
|
gRRosminet n00b
Joined: 11 Feb 2006 Posts: 19
|
Posted: Thu Jul 27, 2006 2:25 pm Post subject: |
|
|
Finally I have made what I didn't want : a script synchronizing the /etc/hosts file and zone files for local domain.
If it can help someone, I have done it folowing this tuto (French) : http://valaurea.free.fr/documents/sig11_bind9_2.html |
|
Back to top |
|
|
|