By now I'm probably showing my ignorance in this area and I would like to brush up. Can anyone recommend a book that explains how common networking protocols work? Something that summarises and gives examples and won't bore me senseless.
Setting up a host name for development server on LAN
Moderator: General Moderators
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
Setting up a host name for development server on LAN
I've now running a development server on my company LAN and I'm using Samba to set a netbios name so that any windows PC can get access to the server simply by typing "dev" in the address bar
. Problem is this doesn't work for Macs. I don't particularly want to set things in the /etc/hosts file. What do I need to do? I tried running DHCP server with some success but I couldn't find a way to do this and concluded that it wasn't really the correct thing to use.
By now I'm probably showing my ignorance in this area and I would like to brush up. Can anyone recommend a book that explains how common networking protocols work? Something that summarises and gives examples and won't bore me senseless.
By now I'm probably showing my ignorance in this area and I would like to brush up. Can anyone recommend a book that explains how common networking protocols work? Something that summarises and gives examples and won't bore me senseless.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
If you're going to set up pnds, it's easy. Install pdns from whatever package manager you have. On a debian system, that would be:
Once you hgave it install, open up /etc/powerdns/pdns.conf and set (at least) the following:
Now, you're using BIND as the backend, which basically mean zone files. So create a named.conf at /etc/named.conf (mine looks like this, but it's basic named config if you want to look it up):
Then create the relevant zone files in /var/named/*.zone. If your DNS server finds a relvent zone it will answer, otherwsie, it will ask your ISPs nameservers.
Code: Select all
apt-get install pdns-serverCode: Select all
allow_recursion (set this to your own network)
launch=bind
bind_config=/etc/named.conf
lazy_recursion=yes
recursor=<your ISPS nameservers>Code: Select all
options {
recursion yes;
notify yes;
directory "/var/named";
};
zone "." IN {
type hint;
file "named.ca";
};
zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};
zone "w3style.co.uk" IN {
type master;
file "w3style.zone";
allow-update { none; };
};
zone "w3style.org" IN {
type master;
file "w3style.org.zone";
allow-update { none; };
};
zone "andrewrose.co.uk" IN {
type master;
file "andrewrose.zone";
allow-update { none; };
};
zone "swiftmailer.org" IN {
type master;
file "swiftmailer.zone";
allow-update { none; };
allow-transfer { any; };
};
zone "marshies21st.com" IN {
type master;
file "marshies21st.zone";
allow-update { none; };
allow-transfer { any; };
};
zone "chriscorbyn.co.uk" IN {
type master;
file "chriscorbyn.zone";
allow-update { none; };
};
zone "markymarky.co.uk" IN {
type master;
file "markymarky.zone";
allow-update { none; };
};
zone "markcorbyn.com" IN {
type master;
file "markcorbyn.zone";
allow-update { none; };
};
zone "117.94.147.217.in-addr.arpa" IN {
type master;
file "117.94.147.217.in-addr.arpa";
allow-update { none; };
};- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
Yes. Please.Hey d, can you post a copy of a zone file for any one of the hosted domains you list here?
Yeah I checked that. Our router is an old netgear that seems pretty crappy. It has crashed on me on a couple of occasions.f you're behind a NAT router with decent firmware (like a WRT54GL) it might let you add your own custom DNS entries to return instead of forwarding the request to the ISP's DNS servers.
That's the whole point of doing this for me. If you run your own DHCP as well and turn off the one on the router you can point it to the DNS on the dev server. Is that right?That way it would work for everyone inside the network, not just your machine.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Code: Select all
$TTL 3600
@ IN SOA ns1.w3style.co.uk. admin.w3style.co.uk. (
2005121907 ; serial
28800 ; refresh
7200 ; retry
604800 ; expire
86400 ; default_ttl
)
@ IN MX 5 mail
@ IN NS ns1.w3style.co.uk.
@ IN NS ns2.w3style.co.uk.
@ IN A 217.147.94.70
;Yes yes I know but it helps ATM
localhost IN A 127.0.0.1
;Servers etc
www IN A 217.147.94.70
mail IN A 217.147.94.70
ftp IN CNAME www
smtp IN A 217.147.94.117EDIT | Just to keep anyone quiet about the lone MX record. I don't use that domain for email... it's the swiftmailer domain and I test with it.
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Code: Select all
$TTL 3600
@ IN MX 5 mail
@ IN NS ns1.w3style.co.uk.
@ IN NS ns2.w3style.co.uk.
@ IN A 217.147.94.70
;Yes yes I know but it helps ATM
localhost IN A 127.0.0.1
;Servers etc
www IN A 217.147.94.70
mail IN A 217.147.94.70
ftp IN CNAME www
smtp IN A 217.147.94.117Code: Select all
$TTL 3600Code: Select all
@ IN SOA ns1.w3style.co.uk. admin.w3style.co.uk. (
2005121907 ; serial
28800 ; refresh
7200 ; retry
604800 ; expire
86400 ; default_ttl
)The @ sign means that the line which follows applies to the base domain (so here, in named.conf it was defined as swiftmailer.org, so the @ basically means "swiftmailer.org"). IN is the keyword you use to specify which type of record you're defined (i.e. IN A, IN CNAME, IN MX...).
SOA is start-of-authority. It's basically the machine that hold the authoritive information for the domain (the primary NS). You don't need to put the IP address, and you shouldn't really. The domain name is the thing you should put.
2005121907 ; serial
That's a serial number. It's not crucial. It's basically YYYYMMDDXX where YYYYMMDD is the date of the last update you made to the zone file, and XX is the number of the update you made that day. Obviously I was busy this day! It was my 7th update.
28800 ; refresh
This is like the TTL, except it's only honoured by slave DNS servers.
7200 ; retry
In the event of a problem, retry in 7200 seconds.
604800 ; expire
This is for cahed data and slave DNS servers. Basically, TTL and refresh specify the time durations to get new information from the zone file. But this value here is in the vent that your server has been offline for a long time and the slave DNS server have been unable to refresh their data. They will continue to give out their copy of the data until this time is reached.
86400 ; default_ttl
I actually can't remember what that's there for when TTL is at the top.... it's probably for the slave servers to take note of
Code: Select all
@ IN MX 5 mail
@ IN NS ns1.w3style.co.uk.
@ IN NS ns2.w3style.co.uk.
@ IN A 217.147.94.70Code: Select all
;Yes yes I know but it helps ATM
localhost IN A 127.0.0.1Code: Select all
;Servers etc
www IN A 217.147.94.70
mail IN A 217.147.94.70
ftp IN CNAME www
smtp IN A 217.147.94.117http://www.swiftmailer.org, mail.swiftmailer.org, ftp.swiftmailer.org etc etc. It should make sense, it's in the same format as those lines starting with @ except we're using subdomains, not the base domain.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Awesome. I think I know what went wrong for me.
If I could ask, does changing the default host name have any significant on the DNS? Say I wanted to change the host name on my server from fc31655.aspadmin.net to something prettier, like d11wtqrocksthehizzie.everah.com, could I do that without breaking everything on the machine? Or should I leave it as is?
Thanks again d11. I think you should write a tutorial. Your explanation, though similar to others on the web, made a lot more sense and was much easier to follow.
If I could ask, does changing the default host name have any significant on the DNS? Say I wanted to change the host name on my server from fc31655.aspadmin.net to something prettier, like d11wtqrocksthehizzie.everah.com, could I do that without breaking everything on the machine? Or should I leave it as is?
Thanks again d11. I think you should write a tutorial. Your explanation, though similar to others on the web, made a lot more sense and was much easier to follow.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
If you mean the host name in the environment variable $HOSTNAME, no it won't matter. That's just for your machine.
It took me a while to get my head around it all when I was starting out. I was using spaces rather than tabs which actually caused problems when parsing my zone files initially
Having a tool like "dig" installed is a godsend when playing around with DNS stuff.
It took me a while to get my head around it all when I was starting out. I was using spaces rather than tabs which actually caused problems when parsing my zone files initially
Having a tool like "dig" installed is a godsend when playing around with DNS stuff.