LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-26-2011, 12:10 AM   #1
daniil
LQ Newbie
 
Registered: Sep 2009
Posts: 28

Rep: Reputation: 0
/etc/hosts modification isn't affected


Hello

I have embedded linux (apm distributive).
I modify /etc/hosts file and that changes not affected.

What could be the problem? Any suggests.

Example
/etc/hosts
127.0.0.1 localhost
127.0.0.1 hana-009

ping hana-009
ping: bad address 'hana-009'
 
Old 04-26-2011, 12:21 AM   #2
k3lt01
Senior Member
 
Registered: Feb 2011
Location: Australia
Distribution: Debian Wheezy, Jessie, Sid/Experimental, playing with LFS.
Posts: 2,900

Rep: Reputation: 637Reputation: 637Reputation: 637Reputation: 637Reputation: 637Reputation: 637
Quote:
Originally Posted by daniil View Post
Hello

I have embedded linux (apm distributive).
I modify /etc/hosts file and that changes not affected.

What could be the problem? Any suggests.

Example
/etc/hosts
127.0.0.1 localhost
127.0.0.1 hana-009

ping hana-009
ping: bad address 'hana-009'
This is mine so I would suggest you need to put another 1 in your hana-009 line.
Code:
127.0.0.1	localhost
127.0.1.1	michael-laptop
 
Old 04-26-2011, 12:34 AM   #3
daniil
LQ Newbie
 
Registered: Sep 2009
Posts: 28

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by k3lt01 View Post
This is mine so I would suggest you need to put another 1 in your hana-009 line.
Code:
127.0.0.1	localhost
127.0.1.1	michael-laptop
It doesn't work.

I have another kind of problem. The problem is that /etc/hosts didn't affected at all. Even if remove locahost. ping localhost works.
It seems that there is a different file.
 
Old 04-26-2011, 01:02 AM   #4
k3lt01
Senior Member
 
Registered: Feb 2011
Location: Australia
Distribution: Debian Wheezy, Jessie, Sid/Experimental, playing with LFS.
Posts: 2,900

Rep: Reputation: 637Reputation: 637Reputation: 637Reputation: 637Reputation: 637Reputation: 637
Take a look at hosts.conf and resolve.conf
 
Old 04-26-2011, 01:19 AM   #5
daniil
LQ Newbie
 
Registered: Sep 2009
Posts: 28

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by k3lt01 View Post
Take a look at hosts.conf and resolve.conf
Actually I don't have host.conf. So I have created one

#host.conf
orders hosts,bind
multi on

#resolve.conf.
nameserver xx.xx.xx.xx
nameserver xx.xx.xx.xx

Actually my network works.
 
Old 04-26-2011, 01:48 AM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Code:
#
# /etc/host.conf - resolver configuration file
#
# Please read the manual page host.conf(5) for more information.
#
#
# The following option is only used by binaries linked against
# libc4 or libc5. This line should be in sync with the "hosts"
# option in /etc/nsswitch.conf.
#
order hosts, bind
#
# The following options are used by the resolver library:
#
multi on
You may want to add "order hosts, bind" to /etc/host.conf

Also, do you have an /etc/nsswitch file?
It should include lines
Code:
hosts:          files mdns4_minimal [NOTFOUND=return] dns
networks:       files dns
You can run "getent hosts www.google.con" to test if host resolution is running.
 
Old 04-26-2011, 02:08 AM   #7
daniil
LQ Newbie
 
Registered: Sep 2009
Posts: 28

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jschiwal View Post
Code:
#
# /etc/host.conf - resolver configuration file
#
# Please read the manual page host.conf(5) for more information.
#
#
# The following option is only used by binaries linked against
# libc4 or libc5. This line should be in sync with the "hosts"
# option in /etc/nsswitch.conf.
#
order hosts, bind
#
# The following options are used by the resolver library:
#
multi on
You may want to add "order hosts, bind" to /etc/host.conf

Also, do you have an /etc/nsswitch file?
It should include lines
Code:
hosts:          files mdns4_minimal [NOTFOUND=return] dns
networks:       files dns
You can run "getent hosts www.google.con" to test if host resolution is running.
It seems the distributive has non standard configuration.

Also there is a strange thing that if I remove localhost entry from /etc/hosts; ping localhost works. On my another board it doesn't.
 
Old 04-26-2011, 03:19 AM   #8
daniil
LQ Newbie
 
Registered: Sep 2009
Posts: 28

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by daniil View Post
It seems the distributive has non standard configuration.

Also there is a strange thing that if I remove localhost entry from /etc/hosts; ping localhost works. On my another board it doesn't.
The solution is always the simplest.

In that APM distributed there is wired system of network configuration.
All I had to do just down and up the eth0.

Thanks for you replies.
It enrich my linux knowledge
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/etc/inet/hosts modification question mokku Solaris / OpenSolaris 2 04-03-2008 09:34 PM
bios affected by ubuntu? poopship21 Linux - Newbie 1 06-11-2006 11:27 AM
/etc/hosts modification crapped out sudo, synaptic, anything requiring admin hexter Ubuntu 1 11-30-2005 11:58 AM
how to clean virus after affected samwzm Linux - Security 8 09-15-2003 09:54 AM
Not Affected lakshman Linux - General 2 10-11-2002 10:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration