Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Need to set hostname and domain name

Hi All,

I need to

1) set my "hostname" (foo), and
2) set my "domain name" (acme.local)

such that my machine identifies itself as "foo.acme.local". Anyone know how to do this? (I found the host name in file sharing, but it will not let me set the domain name.)

Many thanks,
-T

Mac OS X (10.6.4)

Posted on Oct 3, 2010 4:59 PM

Reply
Question marked as Top-ranking reply

Posted on Oct 3, 2010 5:04 PM

You can be "foo" or you can be "acme", but being both is hard to do.

Your built-in Bonjour domain is "local". If you set your machine's name to be either "foo" or "acme", then you can be "foo.local" or "acme.local" respectively. You don't need another level of name redirection. You would have to do some nameserver work to accomplish that. If you just want your machine to respond to "foo.acme.local", you can just add a line in your /etc/hosts file that looks like:
127.0.0.1 foo.acme.local
8 replies
Question marked as Top-ranking reply

Oct 3, 2010 5:04 PM in response to Todd twice

You can be "foo" or you can be "acme", but being both is hard to do.

Your built-in Bonjour domain is "local". If you set your machine's name to be either "foo" or "acme", then you can be "foo.local" or "acme.local" respectively. You don't need another level of name redirection. You would have to do some nameserver work to accomplish that. If you just want your machine to respond to "foo.acme.local", you can just add a line in your /etc/hosts file that looks like:
127.0.0.1 foo.acme.local

Oct 3, 2010 5:20 PM in response to etresoft

"local" is one of the domain suffixes (local, com, org, biz, net). It is not my domain name, just the suffix. I need to set the whole thing.

By the way, this computer gets its IP address from a DHCP server, which does tell this Apple what the domain name is. (It gets ignored.)

# /etc/dhcpd.conf
...
option domain-name "acme.local";

I am wondering if 10.6.4 is not capable of handling this kind of standard network naming convention. (FreeBSD, which Apple run on top, is capable, so I am confused.)

If I change the name in /etc/hosts, will Apple over ride it? (I am not at the machine or I would just try it.)

Many thanks,
-T

10.6.4 did not tell the DHCP server what its name was either, so I had to hand add it into my DNS forward and reverse records. AAAAHHHHH!!!!

Oct 4, 2010 5:32 AM in response to Todd twice

Your domain is the name of your server. I am confused about why you feel the need to have a subdomain. What you seek to accomplish is entirely unnecessary and far more involved than just editing a config file.

Todd twice wrote:
"local" is one of the domain suffixes (local, com, org, biz, net). It is not my domain name, just the suffix. I need to set the whole thing.


Give your machine a name in System Preferences > Sharing and it will have the name "whatever.local". That is all you need.

By the way, this computer gets its IP address from a DHCP server, which does tell this Apple what the domain name is. (It gets ignored.)

# /etc/dhcpd.conf
...
option domain-name "acme.local";


That is the config file for your DHCP server. You would use this if your machine were sharing its internet connection, for example. You don't need to edit this file.

I am wondering if 10.6.4 is not capable of handling this kind of standard network naming convention. (FreeBSD, which Apple run on top, is capable, so I am confused.)


MacOS X does not run on top of FreeBSD. They are different operating systems. MacOS X has a POSIX layer which most closely resembles BSD, that is all.

If I change the name in /etc/hosts, will Apple over ride it? (I am not at the machine or I would just try it.)


You do not "change" the name in /etc/hosts. You are just adding entries into your machine's lookup table. You can add as many aliases to as many IP addresses as you want. This is not the same as changing your machine's name, but it may be sufficient for what you are trying to accomplish - assuming I knew that, which I don't.

10.6.4 did not tell the DHCP server what its name was either, so I had to hand add it into my DNS forward and reverse records. AAAAHHHHH!!!!


I strongly advise against editing files you don't understand.

Oct 4, 2010 10:14 AM in response to etresoft

etresoft wrote:
Your domain is the name of your server.


What gave you that idea? My domain name is "acme.local". It is not the name of my server. I have three servers on my network. The one with the DNS, DHCP, and firewall servers on it called "server.acme.local".

I am confused about why you feel the need to have a subdomain.


This is not a subdomain. What gave you the impression I was asking for a subdomain?

What you seek to accomplish is entirely unnecessary and far more involved than just editing a config file.


Pretty easy in Linux and Windows. They just grab the domain name from the DHCP server. Or, you can hand configure them if you wish. Do you know how accomplish same in 10.6.4?

Give your machine a name in System Preferences > Sharing and it will have the name "whatever.local". That is all you need.


I would like to the entire network name displayed correctly. "whatever.local" is incorrect. It should be "machine name.domainname" or "foo.acme.local". In my example, "foo" is the machine name ("whatever" in your example) and "acme.local" is the domain name. (Not the server's name, by the way.)

"System Preferences > Sharing" will not let me add any extra periods. And will not let me change the ".local" either. (In this instance, I want the ".local".)

Here is the reverse rule I had to hand create:
182 PTR foo.acme.local.
(The dot on the end is not a mistake.)

I do not want a stray computer floating around that does not identify itself correctly. "foo.acme.local" is correct. "foo.local" is not.

By the way, this computer gets its IP address from a DHCP server, which does tell this Apple what the domain name is. (It gets ignored.)

/etc/dhcpd.conf
...
option domain-name "acme.local";


That is the config file for your DHCP server. You would use this if your machine were sharing its internet connection, for example. You don't need to edit this file.


You misunderstand. The DHCP server, not on this Mac, is not being used to share Internet connections. It is being used to assign IP addresses to machines on the local network. It is also being used to assign fixed IP's to network printers based on their MAC addresses. In my network, these are "off Internet" addresses. The firewall, also not on this Mac, it used to share a single Internet connection with all the internal users.

Hmmm. I created the file (dhcpd.conf) by hand. And, yes I do need to edit it all the time. Especially when I have bone headed machines on my network that do not follow or respond to standard networking conventions. This Mac does not accept the domain name given to it by my DHCP server and as such my DHCP server will not automatically update my DNS tables.

Evidence of this can be found in the dhcpd.leases, where I had to hand enter
client-hostname "foo";
into the lease table (did not do me any good).

I am wondering if 10.6.4 is not capable of handling this kind of standard network naming convention. (FreeBSD, which Apple run on top, is capable, so I am confused.)


MacOS X does not run on top of FreeBSD. They are different operating systems. MacOS X has a POSIX layer which most closely resembles BSD, that is all.


Interesting. Thank you for pointing out the difference. I bet POSIX know how, just like FreeBSD, which it resembles.

If I change the name in /etc/hosts, will Apple over ride it? (I am not at the machine or I would just try it.)


You do not "change" the name in /etc/hosts. You are just adding entries into your machine's lookup table. You can add as many aliases to as many IP addresses as you want. This is not the same as changing your machine's name, but it may be sufficient for what you are trying to accomplish - assuming I knew that, which I don't.


Then, where do I make the change?


10.6.4 did not tell the DHCP server what its name was either, so I had to hand add it into my DNS forward and reverse records. AAAAHHHHH!!!!


I strongly advise against editing files you don't understand.


I create my entire DNS configuration by hand, including my forward and reverse tables. Oh yes, I understand it, do I ever understand it. You should not jump to conclusions: it is insulting. I am presuming you meant no insult. Just be more careful next time.

I think that what is happening here is that 10.6.4 is not set up to follow standard network naming conventions. I would posit that the idea is to keep home users out of trouble. Probably a good thing. If 10.6.4 is not capable of using standard naming conventions, (or following standard DHCP conventions), I would just like a confirmation of that so I will stop trying to figure out how to do it. And, stop wasting my time and just hand configure any additional Mac's that enter my network.

Again, a "confirmation that it can not be done", or "how to do it" is what I am looking for.

Thank you for the assistance,
-T

Oct 4, 2010 10:19 AM in response to Todd twice

Again, a "confirmation that it can not be done", or "how to do it" is what I am looking for.


Just out of curiosity, does 10.6.4 come in both a "home edition", with full networking conversions disabled and a "Pro Edition" with full network conventions enabled? That would explain a lot. Especially the machine name being set in file sharing.

-T

Oct 4, 2010 11:23 AM in response to Todd twice

Todd twice wrote:
Pretty easy in Linux and Windows. They just grab the domain name from the DHCP server. Or, you can hand configure them if you wish. Do you know how accomplish same in 10.6.4?


It should be the same on the Mac. A more typical question on this forum is why a Mac suddenly acquires some strange name out of the blue.

If you wanted to hand configure it on the Mac, you would use the scutil program.

"System Preferences > Sharing" will not let me add any extra periods. And will not let me change the ".local" either. (In this instance, I want the ".local".)


.local is part of Bonjour. You may want to researching how to integrate properly with it. That may be the problem.

You misunderstand... Hmmm. I created the file (dhcpd.conf) by hand. And, yes I do need to edit it all the time.


Perhaps next time you should preface your posts with something like "I'm a network admin and ...". That way, I know you didn't just type in something posted on a blog from 2006 🙂

This Mac does not accept the domain name given to it by my DHCP server and as such my DHCP server will not automatically update my DNS tables.


Maybe try to give that Mac some domain other than .local. That should tell you if my Bonjour interference theory is correct.

Then, where do I make the change?


Perhaps scutil.

I create my entire DNS configuration by hand, including my forward and reverse tables. Oh yes, I understand it, do I ever understand it. You should not jump to conclusions: it is insulting. I am presuming you meant no insult. Just be more careful next time.


No offense intended. You are posting in the "Using MacOS X 10.6 Snow Leopard" forum. I don't see many network admins here:) Perhaps you should repost in the one of the "Mac OS X Technologies" forums: http://discussions.apple.com/category.jspa?categoryID=162

I suggest either "Networking and the Web" or "Unix". There you will find people who may have actually done something like this.

I think that what is happening here is that 10.6.4 is not set up to follow standard network naming conventions.


It is perfectly capable. But sometimes the hacks from other operating systems do not apply. Are you running Bonjour/mDNSresponder on your Linux and Windows systems? I suspect that is the problem. You may need to find a solution that works better with Bonjour. That solution might also be applicable for the Linux machines if they are running mDNSresponder.

Just out of curiosity, does 10.6.4 come in both a "home edition", with full networking conversions disabled and a "Pro Edition" with full network conventions enabled? That would explain a lot. Especially the machine name being set in file sharing.


There is no difference the capabilities of the "Server" vs the "Client" edition. The Server version does come with a set of Server Admin tools. Their use is not required. What you are trying to setup is not a typical configuration. It is not a home system and it isn't a corporate system either. You are rolling your network and that is going to require some research.

I will see if I can track down some pertinent information. Earlier today I was downloading lots of Apple white papers about such things before Google kicked me off for my "automated surfing" habits. In the meantime, repost your question in a more technical forum and try a domain other than .local just as an experiment.

Message was edited by: etresoft

Oct 4, 2010 12:07 PM in response to etresoft

Perhaps you should repost in the one of the "Mac OS X Technologies" forums: http://discussions.apple.com/category.jspa?categoryID=162


Thank you! Did not even realize that group existed. Hopefully they will not get too ****** at me for double posting (the Windows forums do).

I found reference to scutil in my Google searches. But, I never found it. Maybe I gave up to easily.

Many thanks
-T

Oct 4, 2010 12:16 PM in response to Todd twice

Todd twice wrote:
Thank you! Did not even realize that group existed. Hopefully they will not get too ****** at me for double posting (the Windows forums do).


No problem. I could ask the Hosts to move this question there, but I think I may have gotten it off on the wrong foot anyway. If you want to, just include a link to this question in your new post. This is a busy forum and this question will get moved off the from page pretty soon anyway.

Need to set hostname and domain name

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.