PDA

View Full Version : ISPConfig Local DNS server settings (Ubuntu 12.04 LTS)


neoszion
24th June 2012, 19:54
Hi there,

I have just completed the install of ISP config on my local server and everything is running very smooth. I would like to create websites locally without having to edit my pc host file every time I set up a local site on my server. I also want all of the pc's on my network to go via this server.

How is this possible I am very new to DNS so some light reading would be great :) thanks in advance for you response.

neoszion
25th June 2012, 17:10
*Bump*

Sorry wondered if this is possible?

falko
26th June 2012, 14:00
You must create a local DNS server and then use it in your router settings so that the router tells the client PCs (via DHCP) to use that nameserver.

You can use the DNS module in ISPConfig to create DNS zones.

neoszion
26th June 2012, 15:13
thanks for your reply.

How would I check that the setting I have put into ISP config are running correctly?

neoszion
26th June 2012, 23:18
OK so I set up a Zone and when I do a nslookup of the domain on the the server I get the following error:

eden@eden:/etc/bind$ nslookup eden.local
;; Got SERVFAIL reply from 127.0.0.1, trying next server
;; Got SERVFAIL reply from 127.0.0.1, trying next server
Server: ::1
Address: ::1#53

** server can't find eden.local: SERVFAIL

When I do an NSLookup of the IP I get the following:

eden@eden:/etc/bind$ nslookup 192.168.0.3
Server: 127.0.0.1
Address: 127.0.0.1#53

** server can't find 3.0.168.192.in-addr.arpa.: NXDOMAIN

################################################## #

Not sure where I am going wrong here? Screenshots of my zone page attached.

TiTex
27th June 2012, 12:07
you should have a file pri.eden.local in your /etc/bind/ folder , check if it's there

neoszion
27th June 2012, 19:48
Thanks for your reply.

Yes it is there it contains the following:

#######################################

$TTL 3600
@ IN SOA ns1.eden.local. info@eden.local. (
2012062702 ; serial, todays date + todays serial #
7200 ; refresh, seconds
540 ; retry, seconds
604800 ; expire, seconds
86400 ) ; minimum, seconds
;

eden.local. 3600 A 192.168.0.3
eden.local. 3600 MX 10 mail.eden.local.
eden.local. 3600 NS ns1.eden.local.
eden.local. 3600 NS ns2.eden.local.
mail 3600 A 192.168.0.3
www 3600 A 192.168.0.3

TiTex
27th June 2012, 21:54
can you post the contents of /etc/resolv.conf ?
also is your bind/named service started ?

neoszion
27th June 2012, 21:59
the etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.0.3

Yes the bind name service is running, but to be sure I just done a "sudo service bind9 start"...

TiTex
28th June 2012, 08:59
the first entry in your resolv.conf should be
nameserver 127.0.0.1

check your /etc/network/interfaces and make sure there is an entry like
dns-nameservers 127.0.0.1
do a network restart
/etc/init.d/networking restart
it should work now

neoszion
28th June 2012, 10:38
Thanks for your reply, where do I change the resolv.conf as when I change it directly it rests back to the above value?

TiTex
28th June 2012, 10:54
as far as i know in /etc/network/interfaces you specify the order of the nameservers with
dns-nameservers 127.0.0.1 192.168.0.3 ... , and after a network restart is should update the /etc/resolv.conf with the values in order specified in /etc/network/interfaces .
if this doesn't work for you check /etc/network/run/eth0 or something like that
you can read more about this here http://www.stgraber.org/2012/02/24/dns-in-ubuntu-12-04/

neoszion
28th June 2012, 20:36
Thanks for your posts, I am still getting the following error:

root@eden:/# nslookup eden.local
Server: 127.0.0.1
Address: 127.0.0.1#53

** server can't find eden.local: SERVFAIL

TiTex
28th June 2012, 20:52
how about
nslookup www.eden.local
does it give you the same error?

neoszion
28th June 2012, 20:54
Yes same error :(

TiTex
28th June 2012, 21:04
can you post the contents of the files named.conf and pri.eden.local ?
i'm trying to reproduce the error on a test server (ubuntu 12.04+ispconfig3) but it just doesn't happen :)

neoszion
28th June 2012, 22:18
Thanks your help its appriciated.

this is my /etc/bind/named.conf

// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local

include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";


this is the /etc/bind/named.conf.local
zone "eden.local" {
type master;
allow-transfer {none;};
file "/etc/bind/pri.eden.local";
};

This is the /etc/bind/pri.eden.local
$TTL 3600
@ IN SOA ns.eden.local. info.eden.local. (
2012062806 ; serial, todays date + todays serial #
7200 ; refresh, seconds
540 ; retry, seconds
604800 ; expire, seconds
86400 ) ; minimum, seconds
;

eden.local. 3600 A 192.168.0.3
eden.local. 3600 MX 10 mail.eden.local.
eden.local. 3600 NS ns1.eden.local.
mail 3600 A 192.168.0.3
www 3600 A 192.168.0.3

TiTex
29th June 2012, 18:20
you don't have an A record for ns1 , you can solve this by adding a record like this
ns1 3600 A 192.168.0.3
or replace
eden.local. 3600 NS ns1.eden.local.
with
eden.local. 3600 NS eden.local.
or something else your server will respond to ... like localhost

neoszion
29th June 2012, 20:02
Thanks that worked a treat. But I cant seem to be able add sub domains to different sites. For example:

testing.eden.local

neoszion
29th June 2012, 20:12
Also my /etc/bind/pri.eden.local is getting overwritten on reboot?

TiTex
29th June 2012, 22:20
that's because you should add/delete/edit records through ispconfig

neoszion
29th June 2012, 22:36
Thanks figured it out. Still not sure why sub domains are not working?

TiTex
29th June 2012, 23:06
what do you mean by subdomains ?
creating a separate zone or just a record like sub.eden.local ?

neoszion
30th June 2012, 02:17
Hi TiTex,

I figured it out I was being an idiot and not adding them as zones I was trying to add as a sub domain.

Thanks for all you help its appreciated.

TiTex
30th June 2012, 07:31
no problem , glad i could help

anv
14th October 2012, 12:41
@ neoszion
I also have your same problem, read all post but not solve (pheraphs lost some steps)


you for connect in localhost at your ubuntu server use oneother pc ( a win pc?)


when you create a new site, example site1.com
what you write in the url for to see those site?

how modified the file?
/etc/bind/pri.eden.local


the settings in the dns zone and records are how in the images you post here? or have changed something?

is necessary when you create a site1.com also to add something in the dns record? if yes can post the correctly images? thanks