Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hostname resolution on bind-9.2.1-16 (RH9) 1

Status
Not open for further replies.

sonuteklists

Technical User
Jul 20, 2004
233
0
0
US
I have DNS (bind-9.2.1-16) on RH9. I use it only on the local LAN to resolve addresses. Machines are able to resolve the FQDN of machines in the zone file as well as as outside domains such as google.com.

Now, I wanted to resolve only the hostnames as it shows in the zone file, but am unable to do it. For example,
nslookup hostname.domain.com
resolves fine, but
nslookup hostname
does not resolve and reports a "server not found"

How can I achieve this. I thought I could add entries in the /etc/hosts file, but that didnt work either.

Please advice. Also, let me know if I should post it in the
"DNS/BIND/DHCP/WINS Issues" forum.
Thanks.
 
You need to modify the /etc/resolv.conf and add a "search" parameter on the internal hosts (can be added to DHCP response if you are using DHCP). The search parameter will be added to any hostname that fails to resolve initially, so if you type:

nslookup host

It will request "host" from the DNS server and receive the error about "server not found" and then DNS will automatically try "host.domain.com" as is in the resolv.conf file.

Do a "man resolv.conf" and you should be able to find out more about the DNS configuration options.


pansophic
 
Thanks a bunch!! That helped!! I got it working in the resolv.conf!!
Could you kindly tell me how exactly to do it via "via DHCP"?? What should I specify on the DHCP server then? What if I multiple DHCP servers on different domains?
Please advice!!
 
In your dhcpd.conf file you would need to define a zone that looked something like this:"
Code:
subnet 192.168.10.0 netmask 255.255.255.0 #Internal net
{
        range 192.168.10.32 192.168.10.47;
        option subnet-mask 255.255.255.0;
        option domain-name "domain.com";
        option routers 192.168.10.1;
        option domain-name-servers 198.6.1.2, 24.50.78.2;
        option ntp-servers 192.43.244.18, 66.187.224.4;
        default-lease-time 1800;
        max-lease-time 3600;
} #Internal net

Good luck!


pansophic
 
I am sorry to stick in. I was trying the same and did the same in /etc/resolv.conf. It worked but on the DNS server only when I put in search dnszone (the same one used on the DNS server itself!!). Looking at man resolv.conf, I was a bit confused whether to use search or domain ???

(1) On clients which are using this DNS server they can still use only the FQDN even though they are pointing to only this DNS server. nslookup as well as ping on the clients work only when using the FQDN.

(2) Some times it returns DNS entries from the outside DNS server when I do just the hostname. Obviously that DNS server (which I dont have access to) must be set right !!

(3) What should DNS on the DNS server point to. On the DNS server itself, I have set the second and third DNS to point to external DNS servers to resolve links like yahoo.com. But I find that even if I leave the second and third DNS as blank, it will still resolve yahoo.com. How come ? root hints ?

I am certain I am missing a few things here. I would greatly appreciate it if you could guide me in the right direction. My main goal is to have clients (using the DNS server in question) be able to ping/nslookup records on the DNS server using only the hostname.

Please advice.
Thanks a bunch!!
 
Of course, I can always,
- set the primary DNS suffix on each client
- or do it on the DHCP server.
But I am looking for another option which can be set on the server itself.
Please advice.
 
I am sorry, can anybody provide any pointers at all regarding the third option to be set on the server. Would be grateful even if it says "stupid thought".
Thanks.
 
Appending the domain names is handled by the client, so ther's no way for the server to get it. The server only sees requests for host.search1, host.search2, etc. Or, host.domain if there's no searchdomain specified.
 
So what does /etc/resolv.conf do exactly. I thought it would lookup for client entries in the the domain specified and return if an entry is found for the client in that domain.
For example,
if a A record exists for the client in a particualr DNS zone and that zone is specifies in /etc/resolv.conf, then when I do a,
nslookup hostname
it would find the hostname as an A record in the zone file and return
found hostname.FQDN.com

So, where am I wrong here? In assuming that /etc/resolv.conf settings on the DNS server apply to all the clients that use the DNS server??

It does this for the server itself where I have set /etc/resolv.conf and clients where the DNS search path/suffix has been set, but not other wise.

Re, "so ther's no way for the server to get it."
-> is there a script that can achieve this??

Please advice.
Thanks.
 
The /etc/resolv.conf tells the client "how" to look for names, not "what" to look for.

The client will look for "host" and if that times out it will look for "host.search1" then "host.search2" if it is in the resolv.conf.

There are no zones in the resolv.conf file, that information is in a named.conf file used with BIND (DNS Server) to serve IPs.

The BIND does not refer to its resolv.conf when looking up zones that it maintains, and it only uses the resolv.conf to find other DNS servers for zones that it does not serve.

If you are using a client application on the DNS server, it will use the resolv.conf file just like any other client application on any other computer.

As far as I know, the only way to "fix" it is to put the information in the DHCP server's config or set it on the individual client systems.


pansophic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top