# after dns network trouble

## legit

hey all,

So i've installed and configured maradns on my linux box, it works great except for one thing, i no longer have access to anything outside my home network.  I haven't done anything with iptables so i don't have a clue on how to fix it.  any suggestions?

thanks,

- legit

also i still don't have access when i turn maradns off

----------

## Rob1n

Do you still have your ISPs DNS servers listed in your /etc/resolv.conf (or set as upstream servers in /etc/mararc)?

----------

## legit

Unfortunately every time i edit resolv.conf (as root) it is immediately overwritten with a message that it is a dynamically generated script from somewhere (sorry don't have access to it at the moment).  So even when i add a new dns server to resolv.conf it doesn't help.

Also, I was going to add ICANN servers to my mararc file but anytime i do i lose the ability to have local domains, so I'm not sure if maybe thats the problem (as all my maradns points to is the local domains)

----------

## Rob1n

 *legit wrote:*   

> Unfortunately every time i edit resolv.conf (as root) it is immediately overwritten with a message that it is a dynamically generated script from somewhere (sorry don't have access to it at the moment).  So even when i add a new dns server to resolv.conf it doesn't help.

 

Yes, you'll need to add them to the dns_servers_eth0 (or whatever) list in /etc/conf.d/net

 *Quote:*   

> Also, I was going to add ICANN servers to my mararc file but anytime i do i lose the ability to have local domains, so I'm not sure if maybe thats the problem (as all my maradns points to is the local domains)

 

This shouldn't happen.  In fact, you shouldn't need to add anything to get the ICANN servers working (they're enabled by default).  Do you have the recursive_acl variable set appropriately for your network?

----------

## legit

ok, interesting situation, if i define dhcp to get an ip then i get through to the internet fine (without maradns running).  With a static IP I don't have access to the internet, even without mara running.  this help any?

----------

## Rob1n

There's a few possibilities here.  It could be routing; DNS; or firewalling.  You can rule out a routing/firewalling problem by trying to ping an IP address - try 66.219.59.46 (www.gentoo.org).  If this pings okay then the problem is with the DNS setup.  If it fails then it's either routing or firewalling.  If it's a routing problem then the ping should fail with a "No route to host" type of error.  If it's firewalling then you'll need to check both your iptables setup and your router - they sometimes have an option to block all hosts they've not handed out an IP address to.

----------

## legit

Interesting, well pinging an external IP address fails with either "network not found" or another error (sorry, not at the box, ill update later)  and I haven't done anything with IP tables so that shouldn't be it. I've had a static ip before and my router handled it fine but I've never run a dns server before.  then again with a static ip and no dns running i still get no outside access.  I'll investigate more deeply later on today.

----------

## NeddySeagoon

legit,

That sounds like a missing default route in your routing table.

What does route show ? 

```
$ /sbin/route 

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.100.0   *               255.255.255.0   U     0      0        0 eth_lan

loopback        *               255.0.0.0       U     0      0        0 lo

default         Moriarty        0.0.0.0         UG    0      0        0 eth_lan
```

I suspect your line starting default is missing or incorrect.  route -n will show you IP numbers

----------

## legit

you're right, my default entry is missing, 

route shows this:

```
Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

10.0.0.0        *               255.0.0.0       U     0      0        0 eth1

loopback        *               255.0.0.0       U     0      0        0 lo

```

how can i add the default route back?

----------

## legit

Nevermind, I figured it out.

```

route add default gw 10.0.0.2

```

Thanks for figuring it out NeddySeagoon, it works great now.  and once again rob1n thanks for all the help.

- legit

----------

## Rob1n

You should also make sure to add this to /etc/conf.d/net so it's applied automatically in future:

```

routes_eth0=( "default via 10.0.0.2" )

```

----------

