Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

Network setup: subdomain pointing to homeserver?

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
9 posts • Page 1 of 1
Author
Message
tkhobbes
Guru
Guru
User avatar
Posts: 367
Joined: Fri Nov 12, 2004 8:46 am
Location: Switzerland
Contact:
Contact tkhobbes
Website

Network setup: subdomain pointing to homeserver?

  • Quote

Post by tkhobbes » Sat Dec 29, 2007 4:05 pm

Hi all

I had an idea over christmas how to fix my rather dull and meaningless network setup at home. However, as I am no expert on this topic, I thought I'd share it here, hoping someone could share some thoughts on this.

So, here's the general idea:
  • I own a domain which is hosted somewhere for www / internet e-mail (shared host, managed).
  • At home, I have a gentoo box used as a "server" - mainly for data storage (but see below...)
  • At home, I am behind a router doing NAT (1 public IP)
What I now want to do is have the subdomain subdomain.mydomain.com to be a "private" / "internal" subdomain - i. e. I want all the hosts in my home network (3 boxes plus guests) and my server to be within this domain; also, I want that the server is in a way "responsible" for this domain, in terms of name services and local mail delivery.
Therefore, there shall be a postfix running on the server, which is responsible for delivering mails of the form user@subdomain.mydomain.com (while mail of the form user@domain.com is still handled by my ISP).

I am not so sure about the DNS stuff; what I DON'T want is that the server has to be up and running all the time; that is, if my girl-friend turns on her laptop, the router shall give her an IP (via DHCP) and she shall be able to use the Internet (of course, if she wants to use the Intranet, she'd have to turn on the server); therefore, DHCP shall still be handled by the router for the whole home-network.

However, I want the allocation of hostname to IP-address (and / or vice-versa) to be known all over my internal network - that is, the server somehow should match IP's to hostnames in a central way (as my hosts always have the same name - maybe it could somehow look for hosts on the network, get their IPs and record them somewhere?) --> this is the part I really have absolutely no idea about - I even have difficulties in expressing myself, as I just realize... :(

So, in summary:
  • How do I set up the DNS stuff? The absolute minimum is that all the hosts know that server.subdomain.mydomain.com is the box on (local) IP 1.1.1.1 - and also, that it is responsible for e-mail delivery in this local subdomain
  • What exactly has to be done "externally" (on some DNS records that are managed by my ISP)?
  • Is this at all possible / even a good idea? Maybe there are better ideas around?
Thanks a lot for helping me on this - as said, I am a nobody when it comes to DNS and network stuff like this, so I really appreciate any input!
My systems and some screenshots: http://www.hobbes.ch/techie/
My Gentoo client installation page: http://www.hobbes.ch/techie/gentoo-client/
My Gentoo Server installation: http://www.hobbes.ch/category/server
Top
sleighboy
n00b
n00b
User avatar
Posts: 26
Joined: Fri Oct 28, 2005 11:10 pm
Contact:
Contact sleighboy
Website

  • Quote

Post by sleighboy » Sun Dec 30, 2007 6:39 am

Two approaches, one is to actually have your ISP host this..which they will likely not want to do or will charge you for it..and then, updating is a pain b/c you're waiting on them. So, solution two..

Since the addresses are all going to be private class-C addresses it will only be meaningful to those inside your network. So dedicate a box on your network to run BIND (named) and have it just function as a caching DNS server..but define it as a master for the zone subdomain.mydomain.com and setup the zone file accordingly. You'll need two zones, one for the names and then the reverse zone for the address to name lookups. Then just have all boxes on your network use this internal DNS server as their DNS server.

The samples configs that come with BIND should allow you to build a zone and reverse zone file quite easily.

Just remember that when you run your own internal DNS and boxes want to do reverse lookups and you have not setup a zone it will take about 30 seconds to time-out, so get that reverse zone set up right away.
Top
tkhobbes
Guru
Guru
User avatar
Posts: 367
Joined: Fri Nov 12, 2004 8:46 am
Location: Switzerland
Contact:
Contact tkhobbes
Website

  • Quote

Post by tkhobbes » Sun Dec 30, 2007 11:35 am

Thanks for this! I therefore have to specify the internal DNS server as nameserver in the router's DHCP settings, right?

However, what if the internal server is not running once? For example, my girlfriend just turns on her windows laptop - what will happen if she tries to surf the internet - there won't be name resolution, correct?

And - suppose my host is called myhost - it will get an IP, say 192.168.0.1 from the router. How does the internal DNS server know that myhost.subdomain.domain.com is the host with this IP (and vice versa)?
My systems and some screenshots: http://www.hobbes.ch/techie/
My Gentoo client installation page: http://www.hobbes.ch/techie/gentoo-client/
My Gentoo Server installation: http://www.hobbes.ch/category/server
Top
bunder
Bodhisattva
Bodhisattva
Posts: 5956
Joined: Sat Apr 10, 2004 5:13 am

  • Quote

Post by bunder » Sun Dec 30, 2007 11:41 am

you could always use the external dns server you have and use this option in it's named.conf:
allow-recursion {
192.168.0.0/24;
192.168.1.0/24;
};
changing that to the ip of your router. that way anyone who uses the server can resolve your external hostname, but nothing else, and you can also resolve your internal zone from your lan.

cheers
suppose my host is called myhost - it will get an IP, say 192.168.0.1 from the router. How does the DNS server know that myhost.subdomain.domain.com is the host with this IP (and vice versa)?
you'd have to enable dynamic updates for that to work. never tried that with bind. :?
Neddyseagoon wrote:The problem with leaving is that you can only do it once and it reduces your influence.
banned from #gentoo since sept 2017
Top
tkhobbes
Guru
Guru
User avatar
Posts: 367
Joined: Fri Nov 12, 2004 8:46 am
Location: Switzerland
Contact:
Contact tkhobbes
Website

  • Quote

Post by tkhobbes » Sun Dec 30, 2007 12:03 pm

bunder wrote:you could always use the external dns server you have and use this option in it's named.conf:
allow-recursion {
192.168.0.0/24;
192.168.1.0/24;
};
changing that to the ip of your router. that way anyone who uses the server can resolve your external hostname, but nothing else, and you can also resolve your internal zone from your lan.
OK - this would work, but not in the environment I am in, as the external dns server is the one from my ISP - and it's a shared one (they are hosting a lot of domains), so this would not work. Somehow, it should be "the other way round", if you understand what I mean; I thought of having two entries for the DNS servers, the first one being the one at home (the internal server that could resolve my internal stuff and route everything else to the ISP one), the second one being the one of my ISP...
bunder wrote:
suppose my host is called myhost - it will get an IP, say 192.168.0.1 from the router. How does the DNS server know that myhost.subdomain.domain.com is the host with this IP (and vice versa)?
you'd have to enable dynamic updates for that to work. never tried that with bind. :?
I am not bound to BIND :)
Suppose some other lightweight DNS server software would be more than enough for my few hosts... :)
My systems and some screenshots: http://www.hobbes.ch/techie/
My Gentoo client installation page: http://www.hobbes.ch/techie/gentoo-client/
My Gentoo Server installation: http://www.hobbes.ch/category/server
Top
tkhobbes
Guru
Guru
User avatar
Posts: 367
Joined: Fri Nov 12, 2004 8:46 am
Location: Switzerland
Contact:
Contact tkhobbes
Website

  • Quote

Post by tkhobbes » Sun Jan 13, 2008 10:48 am

*bump*

Any more ideas? Thanks!
My systems and some screenshots: http://www.hobbes.ch/techie/
My Gentoo client installation page: http://www.hobbes.ch/techie/gentoo-client/
My Gentoo Server installation: http://www.hobbes.ch/category/server
Top
sleighboy
n00b
n00b
User avatar
Posts: 26
Joined: Fri Oct 28, 2005 11:10 pm
Contact:
Contact sleighboy
Website

  • Quote

Post by sleighboy » Mon Jan 14, 2008 8:50 pm

The easiest way to do this is to run an internal DNS server and have all internal hosts use it as their primary DNS server. Then you create the subdomain zone on it and manage your own internal DNS.

Just assign names to the addresses on your internal network. If you want very personal names like [b]jimmypc.subdomain.domain.x[/b] and you use DHCP and not have hosts config to static, then you'll want to add that machines MAC address ot your DHCP server to get a certain address. Otherwise, go static for all hosts that use your internal network often..and for others why not just put a whole bunch of [b]hostXXX.subdomain.domaoin.x[/b] placeholders in your zone files.

BIND and dhcpd are really easy to configure and you can find thousands of examples that will work for you.
Top
tkhobbes
Guru
Guru
User avatar
Posts: 367
Joined: Fri Nov 12, 2004 8:46 am
Location: Switzerland
Contact:
Contact tkhobbes
Website

  • Quote

Post by tkhobbes » Tue Jan 15, 2008 8:47 pm

Thanks, I understood this part. :)

However, what I still don't understand is how I manage the part with "what happens if the internal server is not running"; DHCP is provided by my router, so that my girlfriend can turn on her pc without thinking about the server (which she - pity! - seldom uses...)
But.... what with the DNS? When the internal server is running - np, got that. But when it's not running, how do I manage that one (read: she) is still able to access the internet?
I just don't get it, it seems... :oops:
My systems and some screenshots: http://www.hobbes.ch/techie/
My Gentoo client installation page: http://www.hobbes.ch/techie/gentoo-client/
My Gentoo Server installation: http://www.hobbes.ch/category/server
Top
sleighboy
n00b
n00b
User avatar
Posts: 26
Joined: Fri Oct 28, 2005 11:10 pm
Contact:
Contact sleighboy
Website

  • Quote

Post by sleighboy » Tue Jan 15, 2008 9:22 pm

Well, you would always have your internal DNS server running..you would have a dedicated box for it (if you have a file server, just use that, since it'd ALWAYS be on). For a backup up plan the most practical method would be to have you DHCP server hand out your internal DNS address as the primary and your ISPs DNS server as secondary. That way, if the internal box is down, normal Internet will still work..but the internal name resolution would not, which would be a temporary solution and harms nobody.
Top
Post Reply

9 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy