hostname question
Hi,
I am currently having 3 servers in the lan which is using dynamic IP addresses.* Each time the router is rebooted, I have to reconfigure all the db ips and server ips.* Therefore, I want to assign host name to each machine such as "db" , "ser" etc, so that I don't use 192.168.x.x in my configure anymore.* Is this something that can be done?* Could someone please give me some pointer on how to do it? Thanks, Pete |
hostname question
On Sun, May 11, 2008 at 03:02:12PM +0800, Pete Kay wrote:
> Hi, > > I am currently having 3 servers in the lan which is using dynamic IP > addresses. Each time the router is rebooted, I have to reconfigure all the > db ips and server ips. > > Therefore, I want to assign host name to each machine such as "db" , "ser" > etc, so that I don't use 192.168.x.x in my configure anymore. > > Is this something that can be done? Could someone please give me some > pointer on how to do it? Some routers have the possibility to assign fixed IPs, but I guess you already checked this. It might also work without DHCP, did you try just putting a static config in the respective /etc/network/interfaces? Also, if the router has some kind of DNS caching it might be possible that it can also resolve the names of your local machines. Regards, Andrei -- If you can't explain it simply, you don't understand it well enough. (Albert Einstein) |
hostname question
On 11-May-08, at 12:32 PM, "Pete Kay" <petedao@gmail.com> wrote:
Hi, I am currently having 3 servers in the lan which is using dynamic IP addresses. Each time the router is rebooted, I have to reconfigure all the db ips and server ips. Therefore, I want to assign host name to each machine such as "db" , "ser" etc, so that I don't use 192.168.x.x in my configure anymore. Why not assign ip addresses based on the mac adresses of the individual machines. Since you don't have a big LAN addressing via / etc/hosts should work fine for you and you don't need to learn complicated DNS stuff. -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
hostname question
On Sun, May 11, 2008 at 03:02:12PM +0800, Pete Kay wrote:
> I am currently having 3 servers in the lan which is using dynamic IP > addresses. Each time the router is rebooted, I have to reconfigure all the > db ips and server ips. > > Therefore, I want to assign host name to each machine such as "db" , "ser" > etc, so that I don't use 192.168.x.x in my configure anymore. > > Is this something that can be done? Could someone please give me some > pointer on how to do it? The difficulty is that you would need to keep updating the DNS server with the hostname/IP mapping every time the router is rebooted. If its a rare event and you want just one config file to change, then pick one of your boxes as the DNS server and install dnsmasq. Then put the hostname/IP mappings in that boxe's /etc/hosts file. Have all the other boxes use this box as their DNS server. Alternatively, instead of as you have now (I think): router/DHCPserver | __________________ | | | box1 box2 box3 You could do either use one of your boxes as a router (if it has the capacity) or add a third box of your own which you control between the router and the network. But then what would be the point of the commercial router? What does this router do other than dhcp and a switch? I've never owned a commercial router. Doug. -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
hostname question
On Sunday 11 May 2008 12:02:12 am Pete Kay wrote:
> I am currently having 3 servers in the lan which is using dynamic IP > addresses. Each time the router is rebooted, I have to reconfigure all the > db ips and server ips. > > Therefore, I want to assign host name to each machine such as "db" , "ser" > etc, so that I don't use 192.168.x.x in my configure anymore. > > Is this something that can be done? Could someone please give me some > pointer on how to do it? You should be able to configure static host assignments in DHCP with your router, though you might have to change firmware entirely. http://www.dd-wrt.com/ -- Paul Johnson baloo@ursine.ca Explaination of .pgp part: http://linuxmafia.com/faq/Mail/rant-gpg.html |
hostname question
Hi all,
I have a home server setup running Lenny. I have a question about the hostname and domain name. On my server, I would like to host multiple websites using Apache and virtual hosts. I have a static IP address from my ISP over a DSL line. There is a router (wireless and wired) which routes to different computers on our office LAN, one of which is my server. I have configured the router to use a static IP address for my server (192.168.0.248), with all the other computers being assigned dynamic IPs via DHCP. The router port-forwards the necessary incoming ports (HTTP, ssh) to my server. My question is, how should my /etc/hosts file look. Here is what my current hosts file looks like: 127.0.0.1 localhost 127.0.1.1 MyLocalHostName.MyLocalDomainName MyLocalHostName # The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts My questions are: *) Should I use the static IP assigned by my ISP or on the router? Or is the above correct? *) Can / should the local domain name (used in /etc/hosts) be different from the domain name of the website(s) that I am hosting? ie, using MyLocalDomainName rather than domainname I have registered for my website. If I should use the registered domain name, how do I handle hosting multiple domains on this server? Which domain name would I use? *) How does this differ from what is saved in /etc/hostname? What if these values differ? Who uses /etc/hostname? *) My current /etc/hostname contains the single line: MyLocalHostName.MyLocalDomainName Is that correct? Thanks for your help. Matt. -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
hostname question
On Thu, 31 Dec 2009 12:41:03 +0100, www.givemefish.com wrote:
> I have a home server setup running Lenny. I have a question about the > hostname and domain name. > > On my server, I would like to host multiple websites using Apache and > virtual hosts. (...) Let me first recommend you the reading of a very good article covering Apache2 virtual hosts concept an management (name-based, not ip-based)): Name-based Virtual Host Support http://httpd.apache.org/docs/2.2/en/vhosts/name-based.html > My question is, how should my /etc/hosts file look. Here is what my > current hosts file looks like: > > 127.0.0.1 localhost > 127.0.1.1 MyLocalHostName.MyLocalDomainName MyLocalHostName (...) Do not care much about this, just be sure your DNS server (the responsible to resolve the domains you are going to host) is properly configured and redirecting the queries to your router. Once the queries reach your server, Apache2 will handle the domains, based on the setup you have specified for each of them. > My questions are: > > *) Should I use the static IP assigned by my ISP or on the router? Or > is the above correct? If you have a DNS server making the resolutions for you, I guess /etc/ hosts files is not that relevant. > *) Can / should the local domain name (used in /etc/hosts) be different > from the domain name of the website(s) that I am hosting? ie, using > MyLocalDomainName rather than domainname I have registered for my > website. If you are using your own DNS resolver, then yes, they have to match. But not in /etc/hosts file but /var/lib/named (bind9) or whatever are loacted the files to configure your DNS server. > If I should use the registered domain name, how do I handle hosting > multiple domains on this server? Which domain name would I use? Apache2 handles on its own the domain name resolution, better read the documentation I gave you before. > *) How does this differ from what is saved in /etc/hostname? What if > these values differ? Who uses /etc/hostname? My wild guess is that "/etc/hostnames" is only used when you need to resolver the named locally (on your intranet) but if you want the domain names become available globally (on Internet) you should care the DNS server settings, not /etc/hosts. > *) My current /etc/hostname contains the single line: > > MyLocalHostName.MyLocalDomainName > > Is that correct? It will depend on your desired configuration. How are you (or who is) managing the DNS server in charge of name resolution? Greetings, -- Camaleón -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
hostname question
www.givemefish.com wrote:
> *) Should I use the static IP assigned by my ISP or on the router? Or > is the above correct? The router should have the IP address from your ISP, it will forward requests to your server as per your port forwarding rules. The server doesn't exist on the internet as such, it is on your internal network. Any external hosts on the internet that want to connect to it will connect to your router, which decides which host on your internal network they really want to connect to. I'd suggest a brief look at Network Address Translation, since this is what lets the router work like this. > *) Can / should the local domain name (used in /etc/hosts) be > different from the domain name of the website(s) that I am hosting? > ie, using MyLocalDomainName rather than domainname I have registered > for my website. It can, and there's no technical reason for it to be either the same or different. I'd suggest a reading of the Apache2 docs on Virtual Hosts, they're quite good: http://httpd.apache.org/docs/2.0/vhosts/ Assuming, that is, you're using Apache2.x, though the configuration is much the same for 1.3, from what I can recall. > If I should use the registered domain name, how do I handle hosting > multiple domains on this server? Which domain name would I use? > > *) How does this differ from what is saved in /etc/hostname? What if > these values differ? Who uses /etc/hostname? /etc/hosts is used by the OS for name resolution in the absence of DNS (though when it exits it takes precedence). As far as I'm aware, /etc/hostname is part of the same system. You should use name VirtualHosts to allow Apache to handle hosting multiple domains on the same server. The value of /etc/hostname just allows the box to intercept connections to itself without them having to go to the DNS server. > *) My current /etc/hostname contains the single line: > > MyLocalHostName.MyLocalDomainName > > Is that correct? That's of the correct form. Whether the data is correct or not depends on the configuration of your network. Who runs the network (and more pertinently the DNS server)? They should have told you what your local hostname and domain are. -- Avi Greenbury http://aviswebite.co.uk -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
| All times are GMT. The time now is 01:37 PM. |
VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.