Set domainname manually

I've successfully installed Solaris 10 into vmware machine. I am using vmware's NAT and DHCP.

After system boot, the hostname is set to uknown and domainname is blank (or whatever, I don't remember :)).

I want to specify hostname AND domainname manually. I've been successful with setting hostname. This is what I've done so far:

created /etc/nodename with "myhost" entry

edited /etc/default/dhcpagent,

turned off REQUEST_HOSTAME

deleted number 15 from PARAM_REQUEST_LIST

I created /etc/defaultdomain and entered "mydomain.top"

ok, after boot /etc/hosts looks like this

127.0.0.1 localhost

192.168.25.13 myhost #Added by DHCP

ping myhost works, ping myhost.mydomain.top doesn't

# hostname

returns myhost

# domainname

returns mydomain.top

Editing etc/hosts does nothing good, dhcp always rewrites it... So what am I missing? I am Solaris n00b, used Linux for a while, but still lame.

[994 byte] By [Martin777] at [2007-11-26 11:01:09]
# 1

> created /etc/nodename with "myhost" entry

> edited /etc/default/dhcpagent,

> turned off REQUEST_HOSTAME

> deleted number 15 from PARAM_REQUEST_LIST

>

> I created /etc/defaultdomain and entered

> "mydomain.top"

domainname and /etc/defaultdomain is an NIS thing, not DNS.

Specify any DNS domains you want to add to your search path in /etc/resolv.conf.

search mydomain.top

You can also put the "long" name in /etc/hosts if you want.

> ok, after boot /etc/hosts looks like this

>

> 127.0.0.1 localhost

> 192.168.25.13 myhost #Added by DHCP

>

> ping myhost works, ping myhost.mydomain.top doesn't

DHCP. Maybe you'd prefer to change your hostname to 'myhost.mydomain.top' so that it would put it in /etc/hosts for you.

> # hostname

>

> returns myhost

>

> # domainname

>

> returns mydomain.top

Ignore 'domainname'.

> Editing etc/hosts does nothing good, dhcp always

> rewrites it... So what am I missing? I am Solaris

> n00b, used Linux for a while, but still lame.

I guess the question is, why do you want to resolve a full name like that if it doesn't actually exist in a DNS server somewhere?

You could rewrite /etc/hosts with a script at boot or in cron... Just add an entry with the full name.

--

Darren

Darren_Dunham at 2007-7-7 3:14:52 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 2
Thanks, I need it, because I have virtual network (two vmware imgs) on my home computer ;)
Martin777 at 2007-7-7 3:14:52 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...