# /etc/init.d/domainname dissapeared [SOLVED]

## Noven

Ever since the dawn of Gentoo on Lascivio {my newish laptop} the domainname has been set correctly. A few days ago {after a world update} I first noticed that the computer was now called lascivio.(none) . That is unusual and a bit of a pain. I discovered that /etc/init.d/domainname had dissapeared. /etc/conf.d/domainname still exists and is set correctly. I rebuilt baselayout, but the problem remained. I copied the domainname script from another box and get the error 

```
/etc/init.d/domainname: line 36: /lib/rcscripts/net.modules.d/helpers.d/functions: No such file or directory
```

I checked /lib/rcscripts/net.modules.d/helpers.d/ and the whole directory is empty {save for a .keep file}. Is this the new expected behaviour that I missed hearing about? Or do I have something borked? If the domainname script isn't in baselayout, where abouts would it be?

Entire system on ~x86 , baselayout-1.12.0-r1

----------

## psycepa

now that you mentioned it i see i also do not have that script

i think it is now serviced by /bin/dnsdomainname app or something

the thing is that i have proper configuration in my files

```

cat /etc/conf.d/domainname | grep DNS

DNSDOMAIN="tartar"

cat /etc/hosts

127.0.0.1 localhost virtual

192.168.X.XX other_machine

192.168.X.XX yet_anohter_machine

```

and what is your configuration ?

oh, and 

```

rc-update show | grep domain

```

shows nothing

maby you did etc-update and it cleaned you config or sth ?

----------

## Noven

```

cat /etc/conf.d/domainname | grep DNS

DNSDOMAIN="sincorp.org"

cat /etc/hosts

127.0.0.1 localhost localhost.localdomain

192.168.1.25 lascivio lascivio.sincorp.org

```

Thats been working for me for ages - although without an init.d/domainname script I'm not sure if anything is reading the conf.d/domainname config. 

'domainname sincorp.org' sets the domain name correctly for me - if there is a better way to automatically run that on boot than init.d script I'd love to know it. I can add the command to local.start, but I have a feeling that isn't the 'correct' way.

----------

## psycepa

and isn't it enough to run that command you gave just once ?

----------

## Noven

It doesn't keep the domainname across reboots. For now I've added it to local.start , but I still feel as if this isn't the best way. Everything worked fine while I still had an init.d/domainname script, so if this has been intentionally removed I'd like to discover what method has replaced it.

----------

## psycepa

and if you try sth like that:

```

# /etc/hosts:  This file describes a number of hostname-to-address 

#              mappings for the TCP/IP subsystem.  It is mostly 

#              used at boot time, when no name servers are running. 

#              On small systems, this file can be used instead of a 

#              "named" name server.  Just add the names, addresses 

#              and any aliases to this file... 

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/hosts,v 1.8 2003/08/04 20:12:25 azarah Exp $ 

# 

127.0.0.1       localhost       lascivio.sincorp.org

```

??

----------

## Noven

Okay, a few things. 

A. I can be a blind idiot at times. Changing my hosts file from

```

127.0.0.1 localhost localhost.localdomain 

192.168.1.25 lascivio lascivio.sincorp.org

```

to 

```

27.0.0.1 lasciviolocalhost.localdomain lascivio

192.168.1.25 lascivio.sincorp.org lascivio

```

fixed the initial problem. My old hosts file indeed had it in the latter order - hence things used to work as expected.

B. Quickswitch writes the hosts file the wrong way round. Every time I run it to select the appropriate network {ie. in a normal boot} it rewrites the hosts file in the former order. Hence my issue. 

So the problem is solved, now I have a quickswitch related problem which I'll try to fix and if I can't submit a bug. Thanks for your attempt to help  :Smile: 

----------

## UberLord

We removed the domainname script as you get better and working support in conf.d/net

```
dns_domain="foo.bar"

dns_domain_eth0="wibble.woo"
```

You can setup NIS there too

----------

## Noven

Awesome, thank you so much for that info  :Smile: 

I'm presuming that info was actually put out somewhere and I missed it. Where should I be looking to ensure I stay abreast of such developments?

----------

## UberLord

ebuild messages mainly

----------

