25bb0
![]() |
|
|
|
|
|||||||
| Web & Network Services Discussion related to network/web services such as apache, bind, sendmail, etc. |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hi
I'm trying to set up a name server on a home network. My setup: http://drupal876.co.uk/img/net.jpg I've done a post # sysinstallhttp://drupal876.co.uk/img/sysinstall.jpg In file: /etc/hosts Code:
::1 localhost localhost.org 127.0.0.1 localhost localhost.org 192.168.0.5 manor8 manor8.mydomain.org /etc/resolv.conf Code:
domain mydomain.org nameserver 192.168.0.5 # manor8 nameserver 194.168.4.100 # ISPs nameservers nameserver 194.168.8.100 /etc/rc.conf Code:
hostname="manor8.mydomain.org" ifconfig_re0="inet 192.168.0.5 netmask 255.255.255.0" default_router="192.168.0.1" named_enable="YES" /etc/namedb/db.mydomain.org Code:
$TTL 1d mydomain.org. IN SOA manor8.mydomain.org. admin.mydomain.org. ( 2012042301 ; Serial (date, 2 digits version of day) 1d ; refresh 2h ; retry 100d ; expire 1h ) ; negative cache expiry ;name servers IN NS ns ;MXrecords IN MX 50 manor8.mydomain.org. ns IN A 192.168.0.5 ;Hosts localhost IN A 127.0.0.1 manor8 IN A 192.168.0.5 paula IN A 192.168.0.2 andy IN A 192.168.0.3 jess IN A 192.168.0.4 ;nicknames www IN CNAME manor8 ftp IN CNAME manor8 /etc/namedb/mydomain-reverse Code:
$TTL 1d @ IN SOA manor8.mydomain.org. admin.mydomain.org. ( 2012042301 ; Serial (date, 2 digits version of day) 1d ; refresh 2h ; retry 100d ; expire 2h ) ; negative cache IN NS ns.mydomain.org. 5 IN PTR manor8.mydomain.org. 2 IN PTR paula.mydomain.org. 3 IN PTR andy.mydomain.org. 4 IN PTR jess.mydomain.org. /etc/namedb/localhost.rev Code:
$TTL 1d @ IN SOA manor8.mydomain.org. root.mydomain.org. ( 2012042501 ; Serial 1h ; Refresh 5m ; Retry 100d ; Expire 1h ) ; Negative cache IN NS manor8.mydomain.org. 1 IN PTR localhost.mydomain.org. /etc/namedb/named.conf With the comments removed, it looks like: Code:
// $FreeBSD$
options {
// All file and path names are relative to the chroot directory,
// if any, and should be fully qualified.
directory "/etc/namedb";
pid-file "/var/run/named/pid";
dump-file "/var/dump/named_dump.db";
statistics-file "/var/stats/named.stats";
forwarders {
194.168.4.100; 194.168.8.100;
};
};
...
[details omitted here]
...
zone "mydomain.org" {
type master;
file "db.mydomain.org";
};
zone "0.168.192.in-addr.arpa" {
type master;
file "mydomain-reverse";
};
zone "0.0.127.in-addr.arpa" {
type master;
file "localhost.rev";
};
/var/log/messages For a successful configuration I'm expecting output similar to: Code:
Mar 18 15:01:57 freebie named[69751]: starting (/etc/namedb/named.conf). named 8.3. 4-REL Wed Dec 18 13:38:28 CST 2002 grog@freebie.example.org:/usr/obj/src/FreeBSD/5-S TABLE-FREEBIE/src/usr.sbin/named Mar 18 15:01:57 freebie named[69751]: hint zone "" (IN) loaded (serial 0) Mar 18 15:01:57 freebie named[69751]: master zone "example.org" (IN) loaded (serial 2003031801) Mar 18 15:01:57 freebie named[69751]: Zone "0.0.127.in-addr.arpa" (file localhost.re verse): No default TTL ($TTL <value>) set, using SOA minimum instead Mar 18 15:01:57 freebie named[69751]: master zone "0.0.127.in-addr.arpa" (IN) loaded (serial 97091501) Mar 18 15:01:57 freebie named[69751]: listening on [223.147.37.1].53 (rl0) Mar 18 15:01:57 freebie named[69751]: listening on [127.0.0.1].53 (lo0) Mar 18 15:01:57 freebie named[69752]: Ready to answer queries. Code:
Apr 25 13:01:57 manor8 named[1727]: starting BIND 9.8.1-P1 -t /var/named -u bind Apr 25 13:01:57 manor8 named[1727]: built with '--prefix=/usr' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--enable-threads' '--enable-getifaddrs' '--disable-linux-caps' '--with-openssl=/usr' Apr 25 13:01:57 manor8 named[1727]: command channel listening on 127.0.0.1#953 Apr 25 13:01:57 manor8 named[1727]: command channel listening on ::1#953 Apr 25 13:01:57 manor8 named[1727]: the working directory is not writable Apr 25 13:01:57 manor8 named[1727]: managed-keys-zone ./IN: loading from master file managed-keys.bind failed: file not found Apr 25 13:01:57 manor8 named[1727]: running Code:
cache1.service.virginmedia.net cache2.service.virginmedia.net If I call: # rndc reloadIt reports: Code:
Apr 25 13:52:17 manor8 named[1727]: the working directory is not writable server reload successful The directory is empty by default and in my /etc/namedb/named.conf file I edited the directory option to: Code:
options {
// All file and path names are relative to the chroot directory,
// if any, and should be fully qualified.
// directory "/etc/namedb/working";
directory "/etc/namedb";
help.. |
|
#2
|
||||
|
||||
|
It all looks good, what's not working?
You can test your DNS with the dig(1) command like so: dig @192.168.0.5 manor8.mydomain.orgOr, doing a reverse lookup: dig @192.168.0.5 -x 192.168.0.5
__________________
Senior UNIX Engineer at Unix Support Nederland Experience is something you don't get until just after you need it. |
| The Following User Says Thank You to SirDice For This Useful Post: | ||
c00kie (April 26th, 2012) | ||
|
#3
|
|||
|
|||
|
Thanks. That's reasurring. dig(1) is useful. It reports:
Code:
; <<>> DiG 9.8.1-P1 <<>> @192.168.0.5 manor8.mydomain.org ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<-- opcode: QUERY, status: NOERROR, id: 10322 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1 ;; QUESTION SECTION: ; manor8.mydomain.org. IN A ;; ANSWER SECTION: manor8.mydomain.org. 86400 IN A 192.168.0.5 ;; AUTHORITY SECTION: mydomain.org. 86400 IN NS ns.mydomain.org. ;; ADDITIONAL SECTION: ns.mydomain.org. 86400 IN A 192.168.0.5 ;; Query time: 29 msec ;; SERVER: 192.168.0.5#53(192.168.0.5) ;; WHEN: Thu Apr 26 08:11:53 2012 ;; MSG SIZE rcvd: 86 Code:
Could not find remote server I commented out this line: Code:
// listen-on { 127.0.0.1; };
Another strange thing is if I # cd /etc/namedbthen # pwd I'm expecting to see /etc/namedb But it reveals: /var/named/etc/namedb Is this normal? Last edited by DutchDaemon; April 27th, 2012 at 01:23. Reason: format |
|
#4
|
||||
|
||||
|
Yes, your BIND is correctly configured.
Quote:
Quote:
Quote:
__________________
Senior UNIX Engineer at Unix Support Nederland Experience is something you don't get until just after you need it. Last edited by DutchDaemon; April 27th, 2012 at 01:24. |
| The Following User Says Thank You to SirDice For This Useful Post: | ||
c00kie (April 26th, 2012) | ||
|
#5
|
|||
|
|||
|
Quote:
Hmm... Firstly, I'm using http://mydomain.org purely as a reference. All instances of it are replaced with my 'real' domain of course. Or are you getting at something else here? Last edited by DutchDaemon; April 27th, 2012 at 01:24. Reason: spelling |
|
#6
|
||||
|
||||
|
Yes, that was clear. What wasn't clear is where you expected this to work, it should at least work on your local network. Provided the client you use is configured to use your DNS server.
__________________
Senior UNIX Engineer at Unix Support Nederland Experience is something you don't get until just after you need it. Last edited by DutchDaemon; April 27th, 2012 at 01:24. |
|
#7
|
|||
|
|||
|
Quote:
http://drupal876.co.uk/img/port_forwarding.jpg I have a firewall in place; you may recognise this ![]() pfctl -sr reveals:Code:
anchor "ftp-proxy/*" all block drop all pass in on re0 proto tcp from any to any port = ftp flags S/SA keep state pass in on re0 proto tcp from any to any port > 49151 flags S/SA keep state pass in proto tcp from any to any port = ssh flags S/SA keep state pass in proto tcp from any to any port = http flags S/SA keep state pass out all flags S/SA keep state I'm now sat at machine 192.168.0.2. At the browser enter http://mydomain.org and the page doesn't load... Do I need a new rule(s) in /etc/pf.conf? Purely a guess.. Code:
pass in on re0 proto tcp from any to any port = 53 flags S/SA keep state |
|
#8
|
|||
|
|||
|
How about
Code:
pass in on re0 proto { tcp, udp } from any to any port 53 keep state
cat /etc/services | grep ^domain
__________________
Tenim un nom, el sap tothom: FreeBSD Last edited by DutchDaemon; April 27th, 2012 at 01:25. |
| The Following User Says Thank You to suntzu For This Useful Post: | ||
c00kie (April 26th, 2012) | ||
|
#9
|
||||
|
||||
|
Yes, you need to allow both TCP and UDP to port 53 for DNS to work.
__________________
Senior UNIX Engineer at Unix Support Nederland Experience is something you don't get until just after you need it. |
|
#10
|
|||
|
|||
|
Quote:
With these rules added to /etc/pf.conf, and cat /etc/services | grep ^domainThe system reports: Code:
domain 53/tcp #Domain Name Server domain 53/tcp #Domain Name Server Last edited by DutchDaemon; April 27th, 2012 at 01:25. |
|
#11
|
|||
|
|||
|
Good for local exercise, but it will never go public.
|
|
#12
|
|||
|
|||
|
You're saying it's not possible?
Last edited by DutchDaemon; April 27th, 2012 at 01:26. |
|
#13
|
|||
|
|||
|
Thanks. I've defined my zone files with the local clients IP addresses inclusive. It should work then within the LAN? I've taken your comments on board. And am beginning to think a basic VPS package would be more suitable. I can then have multiple zones all for a flat fee, it's a long way away (and better) from shared hosting.
Last edited by DutchDaemon; April 27th, 2012 at 01:26. |
|
#14
|
|||
|
|||
|
Unfortunately, it won't. Your ISP (nameservers) is the one that has the authority of your domain name.
You may ask the registrar (if you paid more for the service) to point your domain nameserver to your IPs (at least 2), but then you don't have authorization to manage the full network to modify PTR records do you? Even with part subnet classless delegation, I think at least you need 4 IP addresses to be functional, 2 dedicated to DNS server (with warning, because both reside in the same network). Also, you can not publish local IP (RFC-1918). Bear in mind that the only thing DNS do (primarily) is to convert name to address. If somebody somewhere tries to reach a name from your nameservers (which then give them local IP), they're stuck on a host in their local network as well. Last edited by DutchDaemon; April 27th, 2012 at 22:58. |
| The Following User Says Thank You to aa For This Useful Post: | ||
c00kie (April 28th, 2012) | ||
|
#15
|
||||
|
||||
|
c00kie what are you trying to access on these machines form the outside world?
__________________
"Virtually everything worth doing has a learning curve associated with it", anomie. |
|
#16
|
|||
|
|||
|
Quote:
|
|
#17
|
|||
|
|||
|
Quote:
|
|
#18
|
||||
|
||||
|
I'm not clear on what you are referring to as a VPS that would allow you to have "multiple zones for a flat $fee". Are you wanting to host several web hosts, e.g., x.com, y.com z.com? If so, then take a look at virtual hosting with Apache. All you would need is one static IP address.
|
|
#19
|
||||
|
||||
|
Quote:
Quote:
Quote:
I'm a little inexperienced in name servers, so this is all new to me. Quote:
Last edited by DutchDaemon; April 30th, 2012 at 02:06. |
|
#20
|
||||
|
||||
|
Here is a URL to an example of the Apache v2.2.11 httpd-vhost.conf file (i.e., the model that I use to host multiple domains):
http://archaxis.net/htdocs/white_papers/vhost.conf.pdf As I mentioned in the brief, there is much more to configuring Apache than my simple example, but I hope it will get you started. Essentially, Apache becomes your VPS. Also, at first, I'd suggest that you focus more on understanding the Apache configuration, than DNS. As long as you've successfully set up DNS (assuming with BIND), and the authoritive name servers are working, then you can always come back and fine-tune later. I have plans to add to the document. Any questions, certainly ask. Criticism invited, too. Last edited by DutchDaemon; April 30th, 2012 at 02:06. |
|
#21
|
|||
|
|||
|
Thanks. Plug in the values, nice.
|
![]() |
| Tags |
| bind, named |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Squid + squidguard alternative for small home network | ilemur | Web & Network Services | 0 | February 21st, 2012 19:25 |
| [Solved] Home server on FreeBSD | pkubaj | System Hardware | 12 | February 15th, 2012 09:58 |
| Home Network Specs | Simba7 | Off-Topic | 6 | November 20th, 2011 19:55 |
| Setting up home network | Frozen001 | Installing & Upgrading | 5 | June 1st, 2011 13:42 |
| Home server advice | greg_d128 | System Hardware | 1 | December 18th, 2010 09:46 |