Link to home
Start Free TrialLog in
Avatar of Daniel2040
Daniel2040Flag for United Kingdom of Great Britain and Northern Ireland

asked on

BIND v9 setup Name Server to point all requests for domains to ip address

Hi,

I have setup BIND v 9 on my Linux Red Hat Enterprise server and have several domain names i need to point to an IP address.
Can anyone help me with the config.
I have about 100 domain names that all requests for need to be resolved to an address on our network.


Kind Regards,

Daniel.
Avatar of Chris Dent
Chris Dent
Flag of United Kingdom of Great Britain and Northern Ireland image


Hi Daniel,

You mean you need it to do:

nslookup name.com
> IP Address

If so, you will have to add an A record to each zone like one of these:

name.com.  IN A  <IPAddress>
Or
@  IN A  <IPAddress>
Or
IN A <IPAddress>

Chris
Are you asking for them all to point to the same IP or just for examples of how to add each?

To point them all to the same IP, you'll first have to enter them all into your zone file (I'm guessing named.conf) but point them all to the same file.

----
zone "example.com" { type master; file "db.global"; };
zone "example.net" { type master; file "db.global"; };
zone "example.org" { type master; file "db.global"; };
...
zone "example100.com" { type master; file "db.global"; };
----

Then you need to create said file (so db.global in my example) and rather than assign the IP to a specific domain, you use the @ symbol. thus...
"@       IN        A     192.168.100.101"

obviously changing the appropriate data  :-)
Avatar of Daniel2040

ASKER

Thanks,

so all the file named.conf needs to read is:

zone "domain.com" { type master; file "db.global"; };
zone "domain.net" { type master; file "db.global"; };
zone "domain.org" { type master; file "db.global"; };


Kind Regards,

Daniel.
well there's other data in that file like the BIND config options, but the lines posted are all you need to add to the named.conf for the domains.
is it possible to have

zone "*" { type master; file "db.global"; };



Daniel.
you can do

zone "." { type master; file "db.global"; };

and then instead of using "@" use the * for the entry in the db.global there but this will make your nameserver respond with this single answer for ANYTHING that is queried against your nameserver... probably not a good thing.
Thanks for all your help.

Where does the 'db.global' file go?
I have put it in the same directory as 'named.conf' but when i start the service it syas cannot find 'db.global'





Regards,

Daniel.
It should be relative to the 'directory "/path/to/namedb"' option.
Thanks,

sorry for all the questions but what do i do for the NS and SOA records?

Currently the db.global file reads:

$TTL 86400
@       IN        A     81.145.63.83



Kind regards,

Daniel.



ASKER CERTIFIED SOLUTION
Avatar of RSLE
RSLE
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial