# new dhcpcd screwing up my hostname [solved]

## ShodoPan

After updating to dhcpcd 3.0.16, suddenly my computer's hostname is being set to 'M0002B338255A' rather than good old 'localhost'.  I'm confused about where this is coming from, presumably it's being assigned by the dhcp server, as this message in syslog might indicate:

```
Apr  5 13:35:30 localhost dhcpcd[7683]: eth0: setting hostname to `M0002B338255A'
```

Besides just being annoying, this is messing things up, most noticeably my ftp server (proftp), which spits out this:

```
Apr  5 10:49:36 localhost proftpd[6800]: warning: unable to determine IP address of 'M0002B338255A' 

```

It seems like something here is broken:

```
youngian ~ $ hostname 

M0002B338255A

youngian ~ $ hostname -f

hostname: Unknown host
```

So all in all, I'm not sure what's going wrong, but I'd like to get it fixed. Here's some other relevant info:

```
youngian ~ $ cat /var/lib/dhcpcd/dhcpcd-eth0.info

IPADDR='132.161.186.49'

NETMASK='255.255.255.0'

BROADCAST='132.161.186.255'

ROUTES='0.0.0.0,0.0.0.0,132.161.186.1'

HOSTNAME='M0002B338255A'

DNSDOMAIN='grinnell.edu'

DNSSERVERS='132.161.10.60 167.142.225.5'

DHCPSID='132.161.10.60'

DHCPSNAME=''

LEASETIME='2592000'

RENEWALTIME='1296000'

REBINDTIME='2268000'

INTERFACE='eth0'

CLASSID='dhcpcd 3.0.16'

CLIENTID='00:02:b3:38:25:5a'

DHCPCHADDR='00:02:b3:38:25:5a'
```

```
youngian ~ $ cat /etc/conf.d/net

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /etc/conf.d/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

dns_domain_lo="homenet"

dhcp_eth0="nosendhost"
```

I've tried both "nosendhost" and "nodns" in the above file, and neither seems to have an effect.

```
youngian ~ $ cat /etc/conf.d/hostname 

# /etc/conf.d/hostname

# Set to the hostname of this machine

HOSTNAME="localhost"
```

```
youngian ~ $ cat /etc/hosts

# /etc/hosts: Local Host Database

#

# This file describes a number of aliases-to-address mappings for the for 

# local hosts that share this file.

#

# In the presence of the domain name service or NIS, this file may not be 

# consulted at all; see /etc/host.conf for the resolution order.

#

# IPv4 and IPv6 localhost aliases

127.0.0.1       localhost

::1     localhost

#

# Imaginary network.

#10.0.0.2               myname

#10.0.0.3               myfriend

#

# According to RFC 1918, you can use the following IP networks for private 

# nets which will never be connected to the Internet:

#

#       10.0.0.0        -   10.255.255.255

#       172.16.0.0      -   172.31.255.255

#       192.168.0.0     -   192.168.255.255

#

# In case you want to be able to connect directly to the Internet (i.e. not 

# behind a NAT, ADSL router, etc...), you need real official assigned 

# numbers.  Do not try to invent your own network numbers but instead get one 

# from your network provider (if any) or from your regional registry (ARIN, 

# APNIC, LACNIC, RIPE NCC, or AfriNIC.)

#
```

Last edited by ShodoPan on Fri Apr 06, 2007 4:06 am; edited 1 time in total

----------

## Maleita

was the etc-update who made it   :Very Happy:  ,is only make this 

macunaima xeffects # cat /etc/conf.d/hostname 

# /etc/conf.d/hostname

# Set to the hostname of this machine

HOSTNAME="macunaima"

macunaima xeffects #

----------

## lefou

Please append [solved] to the thread title.

----------

## ShodoPan

I already have the name set in /etc/conf.d/hostname:

```
youngian ~ $ cat /etc/conf.d/hostname

# /etc/conf.d/hostname

# Set to the hostname of this machine

HOSTNAME="localhost"
```

So something else must be going wrong (unless I'm missing something here).

----------

## UberLord

 *ShodoPan wrote:*   

> After updating to dhcpcd 3.0.16, suddenly my computer's hostname is being set to 'M0002B338255A' rather than good old 'localhost'.  I'm confused about where this is coming from, presumably it's being assigned by the dhcp server, as this message in syslog might indicate:

 

Right.

dhcpcd will set the hostname given by the DHCP server if given the -H option OR the current hostname is either (none) or localhost.

----------

## ShodoPan

 *UberLord wrote:*   

>  *ShodoPan wrote:*   After updating to dhcpcd 3.0.16, suddenly my computer's hostname is being set to 'M0002B338255A' rather than good old 'localhost'.  I'm confused about where this is coming from, presumably it's being assigned by the dhcp server, as this message in syslog might indicate: 
> 
> Right.
> 
> dhcpcd will set the hostname given by the DHCP server if given the -H option OR the current hostname is either (none) or localhost.

 

Heh, somehow I read that in the man page but never put two and two together. Sure enough, I changed the hostname to something new, and now it works fine. Thanks.

----------

