# Portsnap fetch failed



## QuinRiva (Nov 19, 2013)

I have recently set up a Samba4 DC, and I have just noticed that running `portsnap fetch` fails:

```
root@Pride:/home/test # portsnap fetch
Looking up portsnap.FreeBSD.org mirrors... 7 mirrors found.
Fetching snapshot tag from ec2-ap-southeast-2.portsnap.freebsd.org... failed.
Fetching snapshot tag from ec2-ap-northeast-1.portsnap.freebsd.org... failed.
Fetching snapshot tag from isc.portsnap.freebsd.org... failed.
Fetching snapshot tag from your-org.portsnap.freebsd.org... failed.
Fetching snapshot tag from sourcefire.portsnap.freebsd.org... failed.
Fetching snapshot tag from ec2-sa-east-1.portsnap.freebsd.org... failed.
Fetching snapshot tag from ec2-eu-west-1.portsnap.freebsd.org... failed.
No mirrors remaining, giving up.
```
My guess is that it is that I haven't configured my DNS correctly (BIND9_DLZ).

Manually fetching fails too:

```
root@Pride:/home/test # fetch  http://portsnap2.FreeBSD.org/pub.ssl
fetch: http://portsnap2.FreeBSD.org/pub.ssl: Network is unreachable
```


--------- Diagnostic information -----------​`ping` also fails:

```
PING portsnap.freebsd.org (54.252.93.148): 56 data bytes
ping: sendto: No route to host
```


```
root@Pride:/home/test # dig +trace portsnap.freebsd.org

; <<>> DiG 9.8.4-P2 <<>> +trace portsnap.freebsd.org
;; global options: +cmd
.                       101832  IN      NS      j.root-servers.net.
.                       101832  IN      NS      b.root-servers.net.
.                       101832  IN      NS      l.root-servers.net.
.                       101832  IN      NS      e.root-servers.net.
.                       101832  IN      NS      k.root-servers.net.
.                       101832  IN      NS      g.root-servers.net.
.                       101832  IN      NS      f.root-servers.net.
.                       101832  IN      NS      h.root-servers.net.
.                       101832  IN      NS      a.root-servers.net.
.                       101832  IN      NS      d.root-servers.net.
.                       101832  IN      NS      i.root-servers.net.
.                       101832  IN      NS      m.root-servers.net.
.                       101832  IN      NS      c.root-servers.net.
;; Received 512 bytes from 192.168.0.1#53(192.168.0.1) in 183 ms

;; connection timed out; no servers could be reached
```

`ifconfig`:

```
bge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8009b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,LINKSTATE>
        ether 00:23:ae:63:d8:46
        inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255
        inet6 fe80::223:aeff:fe63:d846%bge0 prefixlen 64 scopeid 0x1
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
plip0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> metric 0 mtu 1500
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x8
        inet 127.0.0.1 netmask 0xff000000
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
```

`netstat -rn`:

```
root@Pride:/home/test # netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
127.0.0.1          link#8             UH          0        0    lo0
192.168.0.0/24     link#1             U           0     2374   bge0
192.168.0.1        link#1             UHS         0      445    lo0

Internet6:
Destination                       Gateway                       Flags      Netif Expire
::/96                             ::1                           UGRS        lo0
::1                               link#8                        UH          lo0
::ffff:0.0.0.0/96                 ::1                           UGRS        lo0
fe80::/10                         ::1                           UGRS        lo0
fe80::%bge0/64                    link#1                        U          bge0
fe80::223:aeff:fe63:d846%bge0     link#1                        UHS         lo0
fe80::%lo0/64                     link#8                        U           lo0
fe80::1%lo0                       link#8                        UHS         lo0
ff01::%bge0/32                    fe80::223:aeff:fe63:d846%bge0 U          bge0
ff01::%lo0/32                     ::1                           U           lo0
ff02::/16                         ::1                           UGRS        lo0
ff02::%bge0/32                    fe80::223:aeff:fe63:d846%bge0 U          bge0
ff02::%lo0/32                     ::1                           U           lo0
```

contents of /etc/rc.conf

```
hostname="Pride.sin.x"
keymap="us.dvorak.kbd"
ifconfig_bge0="192.168.0.1 netmask 255.255.255.0"
ifconfig_bge0_ipv6="inet6 accept_rtadv"
sshd_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="NO"
named_enable="YES"
named_chrootdir=""
cupsd_enable="YES"
samba4_enable="YES"
```

Contents of /etc/resolv.conf

```
# Generated by resolvconf
domain sin.x
nameserver 192.168.0.1 #This server
nameserver 192.168.0.254 #Router
nameserver 192.168.1.1 #Modem
nameserver 203.12.160.35 #ISP DNS Server
nameserver 203.12.160.36 #ISP Backup DNS Server
nameserver 8.8.8.8 #If all else fails
```

Relevant part of /etc/named/named.conf

```
forwarders {
                192.168.0.254;
                203.12.160.35;
                203.12.160.36;
        };
```


----------



## QuinRiva (Nov 19, 2013)

I have managed to resolve the issue by editing /etc/rc.conf

```
defaultrouter="192.168.0.254"
```


----------



## trh411 (Nov 19, 2013)

IIRC, /etc/resolv.conf can have a max of 3 "nameserver" statements. Since none of your first three "nameserver" statements are actually name (DNS) servers, Unless your host is a DNS server, this would be a problem. Get rid of all the "nameserver" statements in /etc/resolv.conf that are not name (DNS) servers.

I was also going to point out your lack of a default route, but see you caught that issue.


----------

