Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Name resolution
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
hielvc
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2805
Location: Oceanside, Ca

PostPosted: Mon Jul 08, 2002 7:04 pm    Post subject: Reply with quote

Here is the script that works with dhcpc, at least at boot time & with cox.net. Youll have to put in your own cox city codes ex: sd > san diego. I took out the pasting of resolv.conf but if you want it leave it in it shouldnt hurt or really help, sigh.
code:
/sbin/dhcpcd ${dhcp_args} ${IFACE} >/dev/null || {
retval=$?
eend ${retval} "Failed to bring ${IFACE} up"
return ${retval}
}
source /etc/dhcpc/dhcpcd-eth0.info
COXIP="${IPADDR//./-}"
echo "127.0.0.1 localhost
$IPADDR ip$COXIP.sd.$DOMAIN gentoo" > /etc/hosts

To see what your real ip looks like the only sight that I can remember that shows it to you is linuxpackages.net. There are more but I dont remeber where.
Back to top
View user's profile Send private message
ebrostig
Bodhisattva
Bodhisattva


Joined: 20 Jul 2002
Posts: 3152
Location: Orlando, Fl

PostPosted: Fri Jul 26, 2002 1:55 am    Post subject: The easiest way to solve this problem... Reply with quote

Hi all!

This problem is really easy to solve.

1. Make sure that dhcpcd is run with the -D -H options

2. Add the following to /etc/init.d/net.eth0 at the end of the start() function:
(echo -n `hostname -i`; echo -n " "; hostname -f; echo "127.0.0.1 localhost" ) > /etc/hosts

Explanation:
echo -n => No newline at the end
`hostname -i` >= Return ip-address
hostname -f >= Return fully qualified domainname, i.e www.gentoo.org

The rest should be obvious....

Good Luck! 8)
Erik
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Thu Aug 22, 2002 7:08 am    Post subject: Reply with quote

Rescued from the depths of Desktop Environments to Documentation, Tips & Tricks.
_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
Mnemia
Guru
Guru


Joined: 17 May 2002
Posts: 476

PostPosted: Mon Sep 02, 2002 1:11 am    Post subject: Reply with quote

Interestingly, if I put the fully qualified hostname (ie host.domain.com) into /etc/hostname, the DHCP server denies me a DNS address mapping, but still gives me an IP address. In other words, it is not possible for me to ping or access the computer by hostname from any other host, but I can ping the IP. If, however, I put only the host part of the hostname in, the server works correctly. Is this correct? Am I doing something wrong, or is the server misconfigured in some way (this is primarily a windows LAN).
Back to top
View user's profile Send private message
iancurtis
n00b
n00b


Joined: 12 Oct 2002
Posts: 69
Location: Texas is the Reason

PostPosted: Fri Oct 18, 2002 8:50 am    Post subject: Reply with quote

So if you just have the loopback "127.0.0.1 localhost" in /etc/hosts your fine right? The threads havent been clear to me. I have RR cable service, and it uses DHCP.
Back to top
View user's profile Send private message
choward
Tux's lil' helper
Tux's lil' helper


Joined: 08 Nov 2002
Posts: 92

PostPosted: Mon Nov 18, 2002 10:16 pm    Post subject: Reply with quote

Another related tip that I found helped me greatly was making sure that nscd is running. nscd stands for the name server caching daemon. Once you look up a name in DNS it is cached for a certain amount of time locally so that DNS can be avoided later on. This is great for loading several webpages from the same server as the DNS lookup is only done once.

nscd comes with glibc I believe.
_________________
Craig Howard
4B Computer Science -- University of Waterloo
Back to top
View user's profile Send private message
riceboy50
n00b
n00b


Joined: 12 Nov 2002
Posts: 48
Location: Southern CA

PostPosted: Wed Jun 11, 2003 6:40 pm    Post subject: fixed fully qualified hostname error Reply with quote

An /etc/hosts file like this
Code:
127.0.0.1 localhost
<my static ip> <my hostname>.<my domain> <my hostname>
nameserver <my nameserver>
nameserver <my nameserver 2>
search <my domain>

An /etc/hostname file like this
Code:
<my hostname>.<my domain>

fixed the apache error "could not find fully qualified hostname, using 127.0.0.1 instead"
Thanks guys :)
_________________
I am logged on therefore I am...
Back to top
View user's profile Send private message
genneth
Apprentice
Apprentice


Joined: 24 Mar 2003
Posts: 152
Location: UK

PostPosted: Thu Jun 12, 2003 12:33 pm    Post subject: And on windows networks... Reply with quote

And for those who run their machines on windows networks (though which network admin would be so stupid (aside from my school's, obviously) as to run a college network on windows servers...), change your /etc/nsswitch.conf to have the following:
Code:

hosts:       files dns wins
networks:    files dns

And have samba installed, of course. This will enable WINS lookup so that all those myriad of insignificant windows machines will resolved.
Back to top
View user's profile Send private message
BliZZZard
n00b
n00b


Joined: 25 Jul 2002
Posts: 52
Location: Colorado Springs, CO

PostPosted: Wed Nov 19, 2003 9:35 pm    Post subject: Rushur? Reply with quote

Just as a not to people trying this... I found the dhcpcd-eth0.info file NOT to be in /etc/dhcpc but in /var/lib/dhcpc/

Code:

source /var/lib/dhcpc/dhcpcd-eth0.info
$IPADDR [hostname]


Just a FYI... :P
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum