View previous topic :: View next topic |
Author |
Message |
shreman n00b
Joined: 04 Feb 2006 Posts: 14
|
Posted: Fri Apr 13, 2007 7:21 pm Post subject: lo netscript overwrites custom resov.conf on boot (solved) |
|
|
this is fresh install
when i boot up i can ping inside my network, but i can't ping outside (google.com)
i've found that my resolv.conf is being overwritten on each boot
my resolv.conf looks like this after i boot up
Code: | # cat /etc/resolv.conf
# Generated by net-scripts for interface lo
domain basement |
if i add a nameserver entry to resolv.conf, the problem is fixed, and i can ping outside my network
Code: | # echo 'nameserver 192.168.2.1' >> /etc/resolv.conf
# cat /etc/resolv.conf
# Generated by net-scripts for interface lo
domain basement
nameserver 192.168.2.1 |
i am here because I have never had this happen before and am unfamiliar with how to stop "net-scripts for interface lo" from re-writing resolv.conf each time i boot.
here is my /etc/conf.d/net, if it is of anyhelp
Code: | # 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="basement"
config_eth0=( "192.168.2.3 netmask 255.255.255.0 broadcast 192.168.2.255" )
routes_eth0=( "default gw 192.168.2.1" ) |
i'd think that this is just a simple problem, i'm just not familiar with whats happening here.
thanks alot.
Last edited by shreman on Sat Apr 14, 2007 2:52 am; edited 1 time in total |
|
Back to top |
|
|
erik258 Advocate
Joined: 12 Apr 2005 Posts: 2650 Location: Twin Cities, Minnesota, USA
|
Posted: Fri Apr 13, 2007 7:35 pm Post subject: |
|
|
Hello! here's your problem. When you specify
Quote: | dns_domain_lo="basement" |
that makes the net initscripts start up lo, and in the process they overwrite resolv.conf. Instead of putting that line there, edit /etc/hosts to list your fqdn. the section on eth0
Quote: | config_eth0=( "192.168.2.3 netmask 255.255.255.0 broadcast 192.168.2.255" )
routes_eth0=( "default gw 192.168.2.1" ) |
doesn't supply nameservers and doesn't use DHCP (which would find out the nameservers for you) so it doesn't overwrite resolv.conf. _________________ Configuring a Firewall? Try my iptables configuration
LinuxCommando.com is my blog for linux-related scraps and tidbits. Stop by for a visit! |
|
Back to top |
|
|
shreman n00b
Joined: 04 Feb 2006 Posts: 14
|
Posted: Fri Apr 13, 2007 7:51 pm Post subject: |
|
|
thank you.
im digging through /etc/conf.d/net.example, and it doesn't seem to say how i specify a nameserver.
i'd perfer not to use dhcp
i gotta get to school, i'll be back |
|
Back to top |
|
|
wynn Advocate
Joined: 01 Apr 2005 Posts: 2421 Location: UK
|
Posted: Fri Apr 13, 2007 8:01 pm Post subject: |
|
|
To set your domain name, you can use the method described in Gentoo Linux x86 Quick Install Guide
Quote: | Set your host and domain name
Set your host name in /etc/conf.d/hostname and /etc/hosts. In the following example, we use mybox as host name and at.myplace as domain name. You can either edit the config files with nano or use the following commands:
Code Listing 2.18: Set host and domain name Code: | livecd / # cd /etc
livecd etc # echo "127.0.0.1 mybox.at.myplace mybox localhost" > hosts
livecd etc # sed -i -e 's/HOSTNAME.*/HOSTNAME="mybox"/' conf.d/hostname
(Use defined host name and check)
livecd etc # hostname mybox
livecd etc # hostname -f
mybox.at.myplace |
|
To set up name servers, use Code: | dns_servers_eth0="192.168.0.2 192.168.0.3" | though, if you're not using DHCP, you can just as easily put them in your /etc/resolv.conf Code: | nameserver 192.168.0.2
nameserver 192.168.0.3 | since net.eth0 will only overwrite it if you use "dns_domain_eth0". _________________ The avatar is jorma, a "duck" from "Elephants Dream": the film and all the production materials have been made available under a Creative Commons Attribution 2.5 License, see orange.blender.org for details. |
|
Back to top |
|
|
shreman n00b
Joined: 04 Feb 2006 Posts: 14
|
Posted: Fri Apr 13, 2007 8:15 pm Post subject: |
|
|
thank you very much. |
|
Back to top |
|
|
|