Hostname and DNS

I'm setting up a Tiger server for the first time since Apple changed the method to set the hostname to automatic and I'm having some DNS problems as a result.

This is a simple OD master on a small LAN. I set up DNS for "server.xxx.com" and pointed it to the local router IP. "Hostname" in terminal returned "xxx.local" so I ran "changeip" to change the hostname to "server.xxx.com."

When I run "hostname" it resolves to "server.xxx.com" and when I run "host server.xxx.com" it resolves to the local IP. I can do a reverse lookup on this IP, too.

Is all as it should be?

Lost count, Mac OS X (10.4.9)

Posted on May 10, 2007 10:36 AM

Reply
13 replies

May 10, 2007 5:25 PM in response to Antonio Rocco

i thought i needed to change from xxx.local to the server.xxx.com because "host xxx.local" did not return my internal ip (not found error)

i just need to have dns working on my internal ip, but system still logs errors because my hostname is set to my internal dns host and not my external ip dns host:

"xserve servermgrd: servermgr_dns: configured name and reverse DNS name do not match (server.xxx.com != www.yyy.com), various services may not function properly - use changeip to repair and/or correct DNS"

my dns needs are pretty simple -- just a hostname that resolves to my internal ip. am i missing something here?

May 11, 2007 1:35 AM in response to Rob Reuland

I think so. All I can do is give you an example of a working DNS that I have here.

Server’s host name is: server.local
Server’s fqdn name is: server.pretendco.org.com
Server’s IP address is: 172.16.1.254

If you launch terminal and issue the host command you will get this:
server.pretendco.org.com has address 172.16.1.254
host 172.16.1.254
254.1.16.172.in-addr.arpa domain name pointer host172-16-1-254.in.addr.pretendco.org.com.

I think you just need to change the server’s .local name back to what it was in the Sharing Preferences pane as well as the relevant place in Server Admin and you should be back to normal.

May 11, 2007 7:37 AM in response to Antonio Rocco

My local DNS works forward and reverse, but I'm getting errors in my server log because my local DNS name does not match my external DNS name (of course). I cannot use changeip "changeip" to correct this because it does not change the primary address from external to internal.

In your example above, your IP and FQDN are external, right?

I'm not running external DNS (or I don't want to) and need only my internal DNS to resolve to my server's internal IP name.

May 11, 2007 8:24 AM in response to Rob Reuland

Hi

My local DNS works forward and reverse, but I'm
getting errors in my server log because my local DNS
name does not match my external DNS name (of course).
I cannot use changeip "changeip" to correct this
because it does not change the primary address from
external to internal.


Unless you absolutely know what you are doing and fully understand the implications of running external DNS services I would not advise doing this. There seems to be some confusion here regarding DNS. The DNS Service available in OSX Server GUI is for internal use only. You can use a real world domain name to run DNS services locally and internally, these should not interfere with external DNS services.

For example www.mydomain.com does not exist locally unless you want it too and unless you point the relevant DNS (external) record to the fixed IP address at your site. Your ISP or the people who host your domain hold and maintain your public DNS Records.

In your example above, your IP and FQDN are external,
right?


Wrong

I'm not running external DNS (or I don't want to) and
need only my internal DNS to resolve to my server's
internal IP name.


If you follow the example given then there is no need to. An example of an external DNS is: www.apple.com which resolves to 17.149.160.10, your server would be servername.apple.com and would resolve to 192.168.1.254, this is for internal use only. You could never resolve www.apple.com to a private IP address. IANA reserve three IP address ranges for exclusive private internal use, these ranges are 192.168.x.x, 10.x.x.x and 172.16.x.x, these should never be used as external IP addresses. Every other IP address is for external (public) use.

May 11, 2007 8:42 AM in response to Antonio Rocco

no, i don't want to run external/publi dns -- i have network solutions pointing my domain names to my public ip

i just want to deal with the error that are coming up on my server logs which tell me there's a mismatch. when i run "changeip -checkhostname" i get:


Primary address = 64.105.XXX.XXX

Current HostName = xserve.clarissa.com
DNS HostName = h-64-105-XXX-XXX.nycmny.covad.net

To fix the hostname please run /usr/sbin/changeip for your system with the
appropriate directory with the following values

"xserve.clarissa.com" is the local DNS name of my server and my DNS points the local IP address to it.

May 11, 2007 8:53 AM in response to Rob Reuland

There is no external DNS for your domain that I can see, if I run dig I get this:

; <<>> DiG 9.3.2 <<>> xserve.clarissa.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 27689
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;xserve.clarissa.com. IN A

;; AUTHORITY SECTION:
clarissa.com. 1700 IN SOA pdns1.ultradns.net. root.cbsig.net. 2002052902 43200 1200 1209600 1800

;; Query time: 36 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Fri May 11 16:51:38 2007
;; MSG SIZE rcvd: 102

This seems to indicate to me there is no external DNS IP address resolving to the hostname xserve.clarissa.com. Where are you getting the 64.105.x.x address from?

May 11, 2007 11:57 AM in response to Rob Reuland

the 64.105- address is my public ip. that's why i'm
wondering about. should it show my local ip?


Yes of course.

The people hosting your domain will keep DNS records for your domain as it appears publicly, this will involve mapping clarissa.com to your 64.104 address.

Looking at the Whois information for this domain the registrant is Viacom International, 1515 Broadway, NYC. If this is not you then you could be in serious trouble. The Domain Servers for this domain are PDNS1.ULTRADNS.NET 204.74.108.1 and PDNS2.ULTRADNS.NET 204.74.109.1 amongst others. You can’t decide to map an unregistered domain name to a public IP address without letting the relevant authorities know first.

May 11, 2007 12:11 PM in response to Antonio Rocco

xserve.clarissa.com is the internal DNS name of my server; it is not intended to be mapped publicly, and my DNS records in house all point internally.

i guess i'm still wondering, for purely internal DNS, what should i see:

1. when i enter hostname in terminal

2. when i enter changeip -checkhostname

at present my only DNS record is for xserve.clarissa.com and it points to 192.168.2.1 and vice versa. "hostname" yields "xserve.clarissa.com"

again, the only worry i have is the system log error and the admonition from changeip to change my hostname

May 11, 2007 3:53 PM in response to Rob Reuland

If you launch terminal and key in hostname you should see ‘xserver.local’, if you key in host ‘xserve.clarissa.com’ you will see ‘xserve.clarissa.com has address 192.168.2.1’, there is a distinction between the two commands, you should change the .local from what it is now to ‘xserve.local’, you do this in the Sharing Preference pane as well as Server Admin, there is no need to run changeip.

There was no need for you to have changed it in the first place. The ‘hostname’ command prints the current name (not its fqdn) of the host system, the ‘host’ command is the DNS lookup utility. If you understand this important distinction and make the change I advise the annoying error message should disappear after a restart.

May 13, 2007 12:43 AM in response to Rob Reuland

1 and 2 : xserve.clarissa.com


In sharing setup you enter only the (host)name (which probably also should be the same in bonjour - doesn't matter for DNS though), in your case : xserve

DNS/hostname seem to be case sensitive so keep all records the same(small caps?).

In Network setup you should enter clarrissa.com as the search domain.

And the server (and all LAN users) should only use 192.168.2.1 as the DNS in Network setup (and in DHCP config ofcourse). For greater lookup speed you probably want to use ISP DNSes as forwarders in /etc/named.conf

If this is the same domainname as your public domainname you have to enter all public IPs used (WWW, FTP and such) in your DNS config too.


If the server is the gw/(NAT)router you need to use the public IP in DNS for the hostname. I don't know of any other way to do it.


To comment on an earlier reply:

DNS in OS X isn't in there only for private DNS use (the DNS GUI in Server Admin in Tiger is of "limited" use though).
The DNS is private if the server DNS is meant for LAN use only and doesn't become public even if running with a public IP (can be controlled with firewall rules if you want).
To become a public DNS for the domain it must be "delegated" from the topdomain used and a second (backup/slave) DNS must be available "somewhere" for the domain in question.

We have a customer hosting about 30 domains on OS X/Bind (server is master/primary / a client is slave/secondary).

If the server is on a /24 netmask there should be no complaints in the logs if DNS is configured correctly. The DNS GUI in Tiger Server Admin doen't seem to cope well with other netmasks and you would have to use the CLI instead.
We had to do it when using a /25 netmask as the delegated reverse zone used has a special "name/look". We also had to enter the hostname in /etc/hostconfig to get IT right. The DNS GUI in Panther was better in my opinion. We are probably going to test the Webmin DNS GUI for Tiger but is seems all GUIs are limited in some way and you have to use the CLI for "special settings".


Also 172.16.0/12 : 172.16.0.0-172.31.255.255 is the third IP-range reserved for private use.

May 13, 2007 12:56 AM in response to Leif Carlsson

Leif --

Thanks for getting in here.

Trouble is ver 10.4.9 now autoconfigures your server hostname, and if the server does NAT/DHCP for the LAN it will make your server hostname the same as the public DNS name. If you change it to something else, you get an error in your server logs.

My server is an OD master connected directly to the modem and serving addreses to a small LAN.

I duly entered "clarissa" for both the local hostname and bonjour name, and set up a single DNS record for "xserve.clarissa.com" pointing to my private IP. When I ran "hostname" I got "xserve.clarissa.com."

But when I connected the server to the net, it became aware that it's name was not "xserve.clarissa.com" but the DNS hostname for my server's public IP. I ran "changeip -checkhostname" and it complained about it and directed me to change the hostname to conform. I did.

Now "hostname" returns my public DNS name, although "xserve.clarissa.com" resolves to my private IP and vice versa.

So, is this OK? Console tells me everything is in sync and happy, but I'm concerned that maybe LDAP might go wonky.

Speaking of wonky . . . its 4 AM for me. To bed!

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Hostname and DNS

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