# [SOLVED] /etc/host.conf: line 24: bad command `mdns off'

## m27315

Whenever I do a netstat, iptables, or any other networking command, I get the following error message:

```
$ netstat -a | grep smtp

/etc/host.conf: line 24: bad command `mdns off'
```

If I comment out line 24 (mdns off), the error goes away.  However, I think a recent update (1-2 months ago) caused this, so I would like to understand the root cause and fix it.

So, why is 'mdns off' a bad command?  What should it be?  I don't want to just make the error go away, I want to understand the problem so I can fix it the right way!

I have seen this error in a lot of posts, but it is never the root problem, so it never gets resolved.  If anybody understands the real solution (beside comment out line #24), I would love to hear it!

TIALast edited by m27315 on Wed Feb 22, 2006 5:55 pm; edited 1 time in total

----------

## todw1fd

For what it's worth, just started showing up on my system.  Can't be more than a week or so since it appeared.  But haven't tracked down the offending update or package.

```
equery belongs host.conf

[ Searching for file(s) host.conf in *... ]

sys-libs/glibc-2.3.6-r3 (/etc/host.conf)
```

I just updated to r3 of glibc.  Have you recently bumped up your glibc?

----------

## j4miel

Same Problem  :Sad: 

Whenever I use emerge --sync ...

----------

## m27315

I'm getting the same error; however, I do not know when I picked up a new version of glibc:

```
$ equery belongs host.conf

[ Searching for file(s) host.conf in *... ]

sys-libs/glibc-2.3.6-r3 (/etc/host.conf)
```

My logs went down for almost a month, so I think it was between Jan 21 and now, but other than that, I can't pinpoint it.  However, I think I remember seeing glibc being updated 1-2 weeks ago during a manual emerge world.

Does anybody know how to fix this?  The right way (beside, commenting out line #24)?    :Very Happy: 

----------

## j4miel

Hmmm ... I emerged glibc yesterday.

Currently using

```

/usr/portage/sys-libs/glibc/glibc-2.3.6-r3.ebuild 

```

Bug ?

----------

## UberLord

https://bugs.gentoo.org/show_bug.cgi?id=123601

----------

## m27315

 *UberLord wrote:*   

> https://bugs.gentoo.org/show_bug.cgi?id=123601

 

So, after reading the bug report, it appears that line #24 was never supposed to be in /etc/host.conf.  So, I guess the fix really is to comment out line #24?

----------

## todw1fd

Guess the bandaid of commenting the offending line in host.conf really is the solutions.  I'm guessing the updated host.conf that will be provided will have no mdns section at all

----------

## m27315

I re-emerged glibc this morning, which included an update to /etc/host.conf to remove the 'mdns off' and related comments.  Problem solved!  Just a transient error...

----------

## Valkura

I am having a similar problem...except it won't let me log into any virtual terminals!  I am afraid to restart it...I commented it out, and it no longer gives me the error message ("Bad command: mdns off"), instead it just waits and then prompts for a user again.  Is it supposed to do this, and should I just restart, or does anyone have any ideas what might be wrong?

----------

## m27315

 *Subie wrote:*   

> I am having a similar problem...except it won't let me log into any virtual terminals!  I am afraid to restart it...I commented it out, and it no longer gives me the error message ("Bad command: mdns off"), instead it just waits and then prompts for a user again.

 

I think this is a different problem.  Best I could tell, the "Bad command: mdns off" statement is nothing more than a warning.  I don't think it actually hurts anything, except possibly generating text at unexpected points in a script.  I had been getting the error message for several weeks, but it never impacted anything, best I could tell.

Really, I think your virtual terminal problem is something else.  I would suggest starting another thread, so we could focus on this new problem.  If you commented out the offending line, and you are still having the problem, then it is almost definitely unrelated to this thread.

Incidentally, you may want to try another update to your box:

```
emerge --sync

emerge --deep --update --newuse -pvt world

emerge --deep --update --newuse world
```

I am surprised that you are still getting this error message.  When was the last time you updated?

----------

## Valkura

 *m27315 wrote:*   

>  *Subie wrote:*   I am having a similar problem...except it won't let me log into any virtual terminals!  I am afraid to restart it...I commented it out, and it no longer gives me the error message ("Bad command: mdns off"), instead it just waits and then prompts for a user again. 
> 
> I think this is a different problem.  Best I could tell, the "Bad command: mdns off" statement is nothing more than a warning.  I don't think it actually hurts anything, except possibly generating text at unexpected points in a script.  I had been getting the error message for several weeks, but it never impacted anything, best I could tell.
> 
> Really, I think your virtual terminal problem is something else.  I would suggest starting another thread, so we could focus on this new problem.  If you commented out the offending line, and you are still having the problem, then it is almost definitely unrelated to this thread.
> ...

 

Yeah, after looking and noticing the "SOLVED" I did start a new thread  :Very Happy:  Someone posted a suggestion there that I shall try.  I updated very recently (don't remember quite when...it has happened a lot as I am trying to get XGL and Compiz running), and the suggestion the other person made is related to that, so I am gonna go try it. Thanks!

----------

## wubante

when you upgraded glibc to glibc-2.3.6-r3,  you must remember to 

```
cp /etc/._cfg000_host.conf  /etc/host.conf 
```

This is not a bug!!

----------

## Braempje

 *wubante wrote:*   

> when you upgraded glibc to glibc-2.3.6-r3,  you must remember to 
> 
> ```
> cp /etc/._cfg000_host.conf  /etc/host.conf 
> ```
> ...

 

Do not do it like that! Use etc-update (or dispatch-conf)! Otherwise any changes in /etc/host.conf will be lost!

----------

## lazyleopard

While using the new version of host.conf does get rid of the "bad command" messages (which, incidentally, will cause problems when they're emitted by, say, exim) it also seems to break something in resolv+. While I'm not getting getting lots of

```
/etc/host.conf: line 24: bad command `mdns off'
```

 and 

```
exim[.*]: 2006-.* T=remote_smtp defer (-19): Malformed SMTP reply from xxx [w.x.y.z] in response to initial connection: /etc/host.conf: line 24: bad command `mdns off'
```

messages any more, I'm now getting lots of 

```
sshd[.*]: Did not receive identification string from UNKNOWN
```

ones. Previously, sshd would list an IP address for these instead of "UNKNOWN".

----------

