Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
06-08-2011, 05:42 AM
|
#1
|
LQ Newbie
Registered: May 2011
Posts: 22
Rep:
|
Host Command only works for FQDN
Hi,
I've set up a dns server (bind 9) on Oracle Linux 5 Update 5. After setting it up, when I run the host command on this dns server, it replys with an ip address only if I use a FQDN. If I just run ...
#host server1
#
... it returns a blank answer. If I run ...
#host server1.domain1.com
#server1.domain1.com has address 10.5.20.54
We have 2 domains in our environment and I'm trying to get forward and reverse lookups to work across both domains using this dns server.
The pertinent parts of named.conf is as follows:
listen-on port 53 { 127.0.0.1; 10.5.20.0/24; };
acl "server-subnet" { 10.5.20.0/24; };
view "internal"
match-clients { localnets; localhost; server-subnet; };
match-destinations { localnets; localhost; server-subnet; };
include "/etc/named.root.hints";
include "/etc/named.rfc1912.zones";
include "/etc/internal_zones.conf";
The internal_zones.conf is as follows:
zone "domain1.com" IN {
type master;
notify no;
allow-query { 127.0.0.1; 10.5.20.0/24; };
allow-update { none; };
file "/var/named/domain1.zone";
};
zone "domain2.com" IN {
type master;
notify no;
allow-query { 127.0.0.1; 10.5.20.0/24; };
allow-update { none; };
file "/var/named/domain2.zone";
};
zone "20.5.10.domain1.in-addr.arpa" IN {
type master;
notify no;
allow-query { 127.0.0.1; 10.5.20.0/24; };
allow-update { none; };
file "/var/named/10-5-20.zone";
};
And here are the zone files.
domain1.zone:
$TTL 3D
@ IN SOA domain1.com. root.localhost. (
2011060801 ; serial number
1H ; refresh
1H ; retry
3D ; expiry
1D ) ; minimum
IN NS localhost
server1 A 10.5.20.54
server2 A 10.5.20.25
domain2.zone:
$TTL 3D
@ IN SOA domain2.com. root.localhost (
2011060801 ; serial number
1H ; refresh
1H ; retry
3D ; expiry
1D ) ; minimum
IN NS localhost
server3 A 10.5.20.215
10-5-20.zone:
$TTL 3D
@ IN SOA domain1.com. root.localhost. (
2011060801 ; serial number
1H ; refresh
1H ; retry
3D ; expiry
1D ) ; minimum
IN NS localhost
54 PTR server1.domain1.com.
25 PTR server2.domain1.com.
215 PTR server3.domain2.com.
So forward lookups only work for FQDN. Reverse lookups works fine for both domains. Just not sure why forward lookups don't work for short names. This dns server's resolv.conf file has only nameserver 127.0.0.1 in it. service named restart has been run each time I make any changes.
First time setting up dns server in linux so any tips would be greatly appreciated. Thanks.
|
|
|
06-08-2011, 05:47 AM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
the dns server should always have an FQDN requested of it. Add a "domain" or "search" entry to the clients resolv.conf
|
|
|
06-08-2011, 08:21 PM
|
#3
|
LQ Newbie
Registered: May 2011
Posts: 22
Original Poster
Rep:
|
Thanks for that tip. I added ...
search domain1.com domain2.com
... to resolv.conf and short name lookups now work. Could I trouble you to explain how it works under the hood?
As in what's the difference between the 2 entries in my resolv.conf file:
search domain1.com domain2.com
nameserver 127.0.0.1
Thanks again.
|
|
|
06-08-2011, 10:27 PM
|
#4
|
LQ Newbie
Registered: May 2011
Posts: 22
Original Poster
Rep:
|
OK, dns queries from within the dns server works fine for both domains (forward and reverse). But now I can't query from the clients.
For example, from server3 (10.5.20.215) its resolv.conf has been updated to:
search domain1.com domain2.com
nameserver 10.5.1.78 #this is the dns server I just set up
When I run ...
# host server1
;; connection timed out; no servers could be reached
# telnet 10.5.1.78 53
Trying 10.5.1.78...
telnet: connect to address 10.5.1.78: Connection refused
telnet: Unable to connect to remote host: Connection refused
Iptables is stopped on the dns server and on the clients as well. I can ping the dns server from the client using ip address.
allow-query is configured for { 127.0.0.1; 10.5.20.0/24; };
Where else should I be looking to get the clients to resolve lookups using the dns server I've set up?
Thanks.
|
|
|
06-08-2011, 10:46 PM
|
#5
|
LQ Newbie
Registered: May 2011
Posts: 22
Original Poster
Rep:
|
OK, ignore last query. I had to include my dns servers interface address in the listen-on option to get clients to talk to it.
Learning linux by the minute! Thanks again.
|
|
|
All times are GMT -5. The time now is 02:56 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|