for a test setup of a software application (with apps, specific hardware and so on) i need to route an public existing domain to an internal server instead of the public server. I would do this with a network, special configured for this test setup. The server with the software, apps and special hardware are in this network. I would rout the requests to the concerning domain to the internal server with a simple DNS server
This DNS server needs to: route all requests to the domain *.internal.net to 192.168.1.200 resolve all other domain names via an external DNS server, e.g. 8.8.8.8
I have some experience with CentOS (our software in running on a CentOS server) so i decided to setup the DNS server on Centos 7. After some Googling i found that i can set up the DNS server under CentOS with named.
After installing named, i changed the /etc/named.conf file as described in one of the tutorials i found via Google. I added at the bottom:
zone "." IN {
type master;
file "internal.net";
allow-update { none; };
};
Te rest of the file is not changed. I also created a file internal.net in /var/named with the following content:
$TTL 3200
@ IN SOA parkzz.net (
2016050204 ; serial
3600 ; refresh
900 ; retry
604800 ; expire
86400 ; nxdomain ttl
)
@ IN NS internal.net
internal.net IN A 192.168.1.200
www.internal.net IN A 192.168.1.200
*.internal.net IN A 192.168.1.200
After executing 'service named restart' and configuring the ip of the DNS server into my windows, i noticed that the domain internal.net was not routed to my "internal" web server.
I also found on the internet that the part (what is inside the /etc/named.conf by default)
zone "." IN {
type hint;
file "named.ca";
};
is used to resolve "unknown" domains over an external DNS server. But i can also not visit other websites like google.nl after i set my DNS IP to the IP of my own DNS server.
What i'm doing wrong? i mean i really need some small basics but can not get it working at all.
Make sure that the named.ca file is populated and up to date. Get a current one by FTP using
wget --user=ftp --password=ftp ftp://ftp.rs.internic.net/domain/db.cache -O /etc/named/named.ca
BIND's logging is usually good by default although you don't mention what OS you are using but it does normally show any configuration errors. A common issue is that it's configured to listen on localhost, which I think is the default so you may need it to listen on an interface.
You can test from your desktop with nslookup in a cmd window with
nslookup -v internal.net 192.168.1.200
which should show if your server is responding at all.You could also use a forwarding DNS server instead so you would need to configure forwarders in your BIND configuration. This guide may help.