# dns-problems

## IndianZ

I have strange problems with Gentoo 2.6.9, stage 3 installed and everything worked fine. After that, I emerged portage and system/world several times, everything worked fine.

Yesterday I emerged a new version of portage and remeber to have pressed -5 instead of -3 when etc-updating. Since then I don't have the possibility to make connections in the internet (Temporary Failure Name Resolution). Connections behind the NAT function as usual, but Internet-Adresses can not be resolved. I controlled /etc/resolv.conf and /etc/conf.d/net - everything ok.

I even tried to re-emerge baselayout (remeber to have it emerged also - as well as automake and autoconf (several versions)...

ping www.indianz.ch    returns    unknown host www.indianz.ch

ping 195.65.88.12        returns    Network unreachable

Any idea where to look for?

----------

## jkt

`ifconfig -a; route -n; cat /etc/conf.d/net; cat /etc/resolv.conf`

----------

## IndianZ

#ifconfig -a

dummy0    Link encap:Ethernet  HWaddr F2:D3:14:7F:F6:81  

          BROADCAST NOARP  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

eth0      Link encap:Ethernet  HWaddr 00:10:A4:02:18:CB  

          inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:66 errors:0 dropped:0 overruns:0 frame:0

          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:7298 (7.1 Kb)  TX bytes:1328 (1.2 Kb)

          Interrupt:3 Base address:0x300 

gre0      Link encap:UNSPEC  HWaddr 00-00-00-00-FF-00-00-00-00-00-00-00-00-00-00-00  

          NOARP  MTU:1476  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:12 errors:0 dropped:0 overruns:0 frame:0

          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:600 (600.0 b)  TX bytes:600 (600.0 b)

#route -n 

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0

127.0.0.0       127.0.0.1       255.0.0.0       UG    0      0        0 lo

#/etc/conf.d/net

iface_eth0="192.168.1.3 broadcast 192.168.1.255 netmask 255.255.255.0"

gateway="eth0/192.168.1.1"

#/etc/resolv.conf

nameserver 80.254.161.125

nameserver 80.254.161.126

----------

## jkt

`ping 192.168.1.1`? does it work? then `ping 66.102.11.104`...

----------

## IndianZ

ping 192.168.1.3 works

ping 192.168.1.1 works

ping 66.102.11.104 connect: Network is unreachable

I saw in route -a that there isn't a gw defined in the 192.168.1.0 subnet. Is that trivial? Or just broadcasting?

----------

## jkt

you have to put

```

gateway="eth0/192.168.1.1"

```

into your /etc/conf.d/net, you wrote you already have it there, but it is impossible  :Smile: 

----------

## IndianZ

well - sorry - but it's already there.

[quote]

gateway="eth0/192.168.1.1" 

[/quote]

in /etc/conf.d/net

that's why I feel helpless...

Any input welcome...

----------

## jkt

and does it say "setting default gateway..." when doning `/etc/init.d/net.eth0 restart`?

----------

## IndianZ

no it doesn't - but it's written in /etc/conf.d/net

when I set it with

route add default gw 192.168.1.1

networking works! Thx a lot!

how about configuring automatically when

it isn't working with /etc/conf.d/net?

----------

## jkt

 *IndianZ wrote:*   

> how about configuring automatically when
> 
> it isn't working with /etc/conf.d/net?

 

must be some bug in /etc/init.d/net.eth0 script  :Sad: . did you run `etc-update`? can you chase it down by adding some debug `echo`s into /etc/init.d/net.eth0?

----------

## IndianZ

I have built a bash script to do automatically configuring:

ifconfig eth0 192.168.1.3 netmask 255.255.255.0 up

route add default gw 192.168.1.1

cp /home/indianz/scripts/resolv.conf /etc/resolv.conf

exit 0

will have a look at the /etc/init.d/net.eth0 later

thanks anyway!

----------

## jkt

hmm, quick & dirty hack, but obviously works  :Smile: . it'd be great if you could find out what's broken in that net.eth0...

----------

## IndianZ

I will - if I find out... ok?

Thanx and have a good time...

----------

## bendy

Hmmmm - glad I saw this post!

I just ran into the same problem after updating a previously working system.  I have my main desktop with a static ip address behind a linksys router, and had the gateway="eth0/192.168.1.1" line in /etc/conf.d/net, and everything worked fine.

After the update, I couldn't contact any ip addresses outside my lan, but everything was fine with local subnet addresses.

I then changed to dhcp instead of static for my desktop, and it started working again!

Then I saw this post, changed back to a static address and the problem was back.  I manually typed:

```
route add default gw 192.168.1.1
```

 and now it's working again.

I can't remember which packages were updated, but something seems to have been broken.  I don't yet know whether the route instruction will survive a reboot.

----------

## Drag0n

 *IndianZ wrote:*   

> route add default gw 192.168.1.1

 

You made my day, thanks a bunch!!!  :Smile: 

Had the same problem after upgrading portage the other day. Don't know what happened though, I did a manual etc-update and I can't remember overwriting anything net-related. Anyways, it'd be great to have it set on boot now...  :Wink: 

Cheers,

Drag0n

----------

## jkt

hey, it's actually quick abnd dirty hack. if your existing setup got broken, it had a reason and needs to be investigated. there's probability that you'll get into trouble if you just ignore it...

btw, routes added by `route` command won't survive reboot.

so, anyone of you having these problems willing to chase it down?

----------

## gungholady

I'm having the same problem. The time this started occuring there was an update to baselayout-1.11.7-r2. It included some new scripts for /etc/init.d one of which was net.eth0. Since I had never made any changes to this file, I had etc-update replace the old script with the new one. I don't remember what the differences were between the old script and the new one.

----------

## ReXX

I can confirm this. It looks like the net.eth0-script is broken in sys-apps/baselayout-1.11.7-r2.

Did sb. file a bugreport yet?

----------

## gungholady

The last time I looked there was no bug report filed on it.

----------

## jkt

well, maybe I'll look at that file if I have some spare time...

----------

## gungholady

I filed the bug report:

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

----------

## jkt

huh, seems lilke major rewrite of the old script  :Sad: .

as a workarround, you could try adding line:

```

modules=( "ifconfig" )

```

into /etc/conf.d/net, but be carefull and backup that file at first.

----------

## jkt

or maybe

```

routes_eth0=(

    "default via 192.168.0.1"

)

```

----------

## dup2

Looks like baselayout-1.11.7-r2 is the problem.

I just upgraded to it and was advised to fix "old net.eth*" scripts by using symlinks to /etc/init.d/net.lo.

However, when restarting the network by 

```
/etc/init.d/net.eth0 restart
```

my gateway specified in /etc/conf.d/net was not applied anymore.

I fixed it with jkt's hint using route_eth0.

Did I miss any update information about the configuration of network interfaces? Is the entry "gateway" not used anymore?

----------

## UberLord

 *dup2 wrote:*   

> Did I miss any update information about the configuration of network interfaces? Is the entry "gateway" not used anymore?

 

It's not documented any more as we have new setup variables - but it should have worked still. It's my fault that it doesn't, but it has been fixed in CVS and will be in the next version.

----------

## dup2

 *UberLord wrote:*   

> 
> 
> It's not documented any more as we have new setup variables - but it should have worked still. It's my fault that it doesn't, but it has been fixed in CVS and will be in the next version.

 

Ok. I'll keep my current route_eth0 setting and retry the gateway variable with the next version unless it will be marked deprecated or similar.

Thx for the work!

----------

## togan

Hi All,

now, problem baselayout-1.11.7-r2 bug

```
#cd /usr/portage/sys-apps/baselayout

#emerge unmerge baselayout && emerge baselayout-1.11.6-r1.ebuild

```

that should it

----------

## UberLord

 *dup2 wrote:*   

> Ok. I'll keep my current route_eth0 setting and retry the gateway variable with the next version unless it will be marked deprecated or similar.

 

The gateway variable is deprecated which is why it's not documented.

----------

## jkt

 *togan wrote:*   

> Hi All,
> 
> now, problem baselayout-1.11.7-r2 bug
> 
> ```
> ...

 

NO!! don't use `emerge file.ebuild`, use `emerge =baselayout-1.11.6-r1` instead. search gentoo forums for posts from ecatmur for explanation.

----------

## gungholady

 *UberLord wrote:*   

> The gateway variable is deprecated which is why it's not documented.

 

With the gateway varieable being deprecated, what is the term and where are we supposed to define the gateway?

----------

## jkt

 *gungholady wrote:*   

>  *UberLord wrote:*   The gateway variable is deprecated which is why it's not documented. 
> 
> With the gateway varieable being deprecated, what is the term and where are we supposed to define the gateway?

 

IMHO, as I wrote,

```

routes_eth0=(

    "default via 192.168.0.1"

)

```

----------

## d_m

 *jkt wrote:*   

> 
> 
> NO!! don't use `emerge file.ebuild`, use `emerge =baselayout-1.11.6-r1` instead. search gentoo forums for posts from ecatmur for explanation.

 

If you could provide a better way to search (or better, a link) it would be appreciated. I'm interested to read the post, but not enough to dig through three pages of search results to try to figure out which one you're referring to.

----------

## jkt

 *d_m wrote:*   

>  *jkt wrote:*   
> 
> NO!! don't use `emerge file.ebuild`, use `emerge =baselayout-1.11.6-r1` instead. search gentoo forums for posts from ecatmur for explanation. 
> 
> If you could provide a better way to search (or better, a link) it would be appreciated. I'm interested to read the post, but not enough to dig through three pages of search results to try to figure out which one you're referring to.

 

well, not sure if it was ecatmur or robmoss:

https://forums.gentoo.org/viewtopic.php?p=812933#812933

https://forums.gentoo.org/viewtopic.php?p=1060314#1060314

----------

## gungholady

[quote="jkt"] *gungholady wrote:*   

>  *UberLord wrote:*   The gateway variable is deprecated which is why it's not documented. 
> 
> IMHO, as I wrote,
> 
> ```
> ...

 

After your previous post, I had looked at that in the /etc/conf.d/sample. I wasn't sure if we were to leave the () in or not. Now I know just how it should be so I can fix it.

----------

