Re: Mac Hostname on Network



On Nov 14, 6:56 pm, Jesus <rustybucket...@xxxxxxxxx> wrote:
On Nov 14, 1:48 am, demp...@xxxxxxxxxxxxx (David Empson) wrote:



Jesus <rustybucket...@xxxxxxxxx> wrote:
Earlier this year, the three Macs I manage began doing something odd -
whenever I plugged them into the network, they'd change their
hostnames to the names of random Windows PCs on the network. I looked
up how to change the hostname in Terminal, but the option I was
supposed to be changing was missing! Since they were running 10.3.9
at the time, I thought doing a fresh install of Leopard would help.
Nope. As soon as I plugged them in, they changed to random Windows PC
names. The network admin insists there's nothing wrong with the
network and doesn't support anything but Windows XP. Why is this
happening? How can I stop it?

Thanks in advance to anybody who can help.

I can tell you almost exactly what's happening, as this has bitten me
before.

The issue is that Windows Server has a "smart" DNS/DHCP/WINS server.

When a PC is hooked up to the network, with a locally configured name,
it looks for a DHCP server, specifying its own name as the DHCP Client
ID and/or identifying its WINS name (which will be the same).

The DHCP server doles out an IP address as expected, and then updates
its DNS server to also set up reverse and forward lookups for the same
IP address.

For example, if your DNS was configured so that the LAN was called
"localdomain" and the PC was "asteroid", and the DHCP server assigned an
address of 192.168.0.17 to that PC, then you can now do a DNS A record
lookup for asteriod.localdomain (which will return 192.168.0.17) and a
PTR lookup for 192.168.0.17 and get asteriod.localdomain.

Some time passes. The PC is turned off.

Along comes your Mac and asks the DHCP server for an IP address. The Mac
is NOT a WINS client, but it supplies its configured name as the DHCP
Client ID.

If the DHCP server gives you a previously unassigned IP address then
everything works as expected. It even updates the DNS to set up a domain
name for you.

If the DHCP server happens to give you an IP address which has
previously been used by the PC, then something odd happens. Because your
Mac didn't register via WINS (I think), or something else about its DHCP
request differs from what Windows sends, the DNS server is _not_
updated. This means that the DNS still has an entry which maps the PC's
name to your Mac's IP address. The Mac's name in the DHCP Clent ID is
ignored.

The Mac does a reverse IP address lookup to see if it has been given a
domain name by the network admin. Lo and behold, there is a name, which
happens to be the one which was set up for the PC. The Mac then uses the
name assigned by the network as its hostname.

End result: the Mac sets its hostname to be the same as a random PC,
depending on which IP address is assigned by the DHCP server, and which
PC happened to be using that address most recently.

This problem went away for me when my office ditched our Windows domain
controller (Small Business Server) and went back to a simple
workgroup-based network and a simpler DNS server. (This was for
unrelated reasons.)

A possible solution, with help from your network admin: it should be
possible to configure the DHCP server to recognise the DHCP Client IDs
from the Macs (name entered on Sharing in System Preferences), and
assign them constant IP addresses. These addresses would be permanently
reserved, so they can't be used by any PC and there would be no name
conflict.

A similar option would be to note the MAC addresses of each Mac, and get
the DHCP server to set up a fixed assignment by network address.

I'm still having a similar problem at home. My MacBook Pro is getting
assigned the wrong hostname because some idiot has set up a public DNS
server which has PTR records for IP addresses in the 192.168 range. I
wish to register a complaint! I can probably ignore it by setting up my
own DNS server but I shouldn't have to.

--
David Empson
demp...@xxxxxxxxxxxxx

Well, crap. That's stupid and, quite frankly, quite arrogant of
Microsoft to assume all clients will register with WINS. I thought I
had tried filling in the WINS area in the Ethernet settings area
before posting here, but I'll have to check what I wrote there.
Whatever, I wrote, it didn't fix the problem. :-) If I can't get it
fixed myself by changing stuff with WINS settings, I'll try asking
about a static IP (not looking forward to that... the sysadmin doesn't
like Macs very much). Do I have to manually change the hostname back
now that the Mac thinks its hostname should be something else?

Thank you for that detailed explanation! That was quite helpful.

Great explanation by David Empson.

You administrator will probably like one of David's solutions. They
are:
"A possible solution, with help from your network admin: it should be
possible to configure the DHCP server to recognise the DHCP Client IDs
from the Macs (name entered on Sharing in System Preferences), and
assign them constant IP addresses. These addresses would be
permanently
reserved, so they can't be used by any PC and there would be no name
conflict.

A similar option would be to note the MAC addresses of each Mac, and
get
the DHCP server to set up a fixed assignment by network address."
by David Empson. See prior post.

This way you still configure you mac to use dhcp, but the DNS server
always give you the same ip address and the address can be configured
not to be one of the pc address.

The address are not technical static ip address sense your DNS server
gives them out, but they won't be changing...

Robert

.



Relevant Pages

  • Re: computer browser service wont start
    ... I've noticed that dnsApi is sometimes one of the things that starts early before everything it needs is actually working, e.g. the TCP/IP and network stack. ... In the situations I've seen the Event Log entry from dnsApi that you report, the computer did successfully register itself later. ... This assumes that the targetted DNS server can accept Dynamic registrations and the computer doing the dynamic registration is permitted to do so. ...
    (microsoft.public.windows.server.general)
  • RE: Problems with Permissions
    ... For the "Network Configuration Wizard" not accessible issue, ... The DHCP not working properly issue may due to DNS not correctly ... ipconfig /all on SBS server, ...
    (microsoft.public.windows.server.sbs)
  • Re: networking private and public hosts questions
    ... some systmes in storage to create a test network. ... a WS to the child and attempted to pull an IP from the DHCP server, ...
    (microsoft.public.win2000.networking)
  • Re: Multiple IP Schemes for Different Buildings
    ... The linksys on your first network stays as it is, ... DHCP broadcast is on the local subnet only, ... router to forward internet traffic to your firewall. ... If each server has it's own DHCP server then I don't need to worry ...
    (microsoft.public.windows.server.general)
  • Re: DHCP setup
    ... It *could* be related to DNS since a mapped drive will probably depend on the DNS server to resolve a server name... ... Access to servers, using mapped drives, copy data etc. ... On the DHCP server console check the scope options, ...
    (microsoft.public.win2000.active_directory)

Loading