Why is adding a new Ubuntu PC to an existing LAN such a pain?
Derek Broughton
news at pointerstop.ca
Tue Jan 23 14:47:51 UTC 2007
Garry Knight wrote:
> Derek Broughton wrote:
>
>> That seems odd.
> ...
>> You _shouldn't_ have to specify the host names anywhere but on the
>> computer that uses that name - it sends its name to the DHCP server, the
>> DHCP server adds that name to its table of hosts, and returns an IP.
>
> It's very odd. My router is set up to use DHCP to assign IPs, but to
> assign the same IP to each machine according to its MAC. My /etc/hosts
> currently looks like this:
>
> 127.0.0.1 localhost
> 192.168.1.2 pc.garry.org pc garry
> 192.168.1.3 thinkpad.garry.org thinkpad laptop
> 192.168.1.4 ipaq.garry.org ipaq pocketpc
>
> So I can ping each machine by IP or by name. Now, if I comment out lines 2
> and 3, I get the following:
>
> [garry ~]$ ping pc
> PING pc.garry.org (209.123.16.48) 56(84) bytes of data.
> 64 bytes from gateway.visual.com (209.123.16.48): ...
> ...
> So whichever host on the LAN I ping, it's routed to 209.123.16.48 even
> though it seems to get the domain name right. Very odd.
That's because, as earlier suggested, garry.org is someone else's domain:
derek at othello:~$ nslookup garry.org
Server: 142.2.13.34
Address: 142.2.13.34#53
Non-authoritative answer:
Name: garry.org
Address: 209.123.16.48
No surprise there, then.
> I should apologise for hijacking the thread, by the way,
well it does seem to be relevant to the original...
> especially as I
> haven't got round to installing Ubuntu onto the laptop yet, so it's
> actually the Mandriva 2007 software that's handling the ping, though I
> doubt that that should make a difference.
Not really.
What's in your /etc/resolv.conf?
The first thing you need is that your domain nameserver should be your
router (so probably 192.168.1.1), then you need to be able to set your
domain name on the router - what model is the router? We should be able to
figure out how you do that.
Then, you either need to use your own Internet domain name, or as suggested
garry.local - you can't use someone else's domain and expect it to work
(though sometimes it will - you just can't count on it). You can even get
a host name at no-ip.com or another dynamic dns service and use it as the
subdomain for your lan (so you have garry.redirectme.net at no-ip, and
pc.garry.redirectme.net at home).
--
derek
More information about the ubuntu-users
mailing list