# access sites and some other networking issues



## ippo (May 7, 2020)

I have problem to access some sites but not all, but I have internet connectivity normally. 
Example this site below cannot be accessed:

https://www.linode.com/community/qu...telnet-on-localhost-25-how-do-i-fix-it-solved

I get the following message in Mozilla;


```
Hmm. We’re having trouble finding that site.

We can’t connect to the server at www.linode.com.

If that address is correct, here are three other things you can try:
```

Also, I was wondering if I am only using ip version 6 and this is the problem.

I am also unable to telnet to localhost 127.0.0.1  but I can ssh.

Also, I am programming a small client server application. The server is listening fine but the client cannot connect to this server on the same machine getting connection refused, while the client can connect and get out from any internet time server. 


Relevant outputs below:

`$  cat /etc/rc.conf`

```
hostname="Tokyo"
keymap="fr.kbd"
ifconfig_re0="DHCP"
ifconfig_re0_ipv6="inet6 accept_rtadv"
local_unbound_enable="YES"
sshd_enable="YES"
moused_enable="YES"
ntpdate_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="AUTO"
kld_list="/boot/modules/radeonkms.ko"
```

`$  ifconfig -a`

```
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
    ether d0:bf:9c:99:4a:2d
    inet6 fe80::d2bf:9cff:fe99:4a2d%re0 prefixlen 64 scopeid 0x1
    inet6 2a02:a03f:3ea9:9700:d2bf:9cff:fe99:4a2d prefixlen 64 autoconf
    inet6 fd60:78c0:18d6:0:d2bf:9cff:fe99:4a2d prefixlen 64 autoconf
    inet 192.168.1.27 netmask 0xffffff00 broadcast 192.168.1.255
    media: Ethernet autoselect (100baseTX <full-duplex>)
    status: active
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
    options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
    inet6 ::1 prefixlen 128
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
    inet 127.0.0.1 netmask 0xff000000
    groups: lo
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
```


```
./daytimetcpcli 127.0.0.1
port: 3328
ip: 127.0.0.1
ip: 0
connect error: Connection refused
```

But the server is listening below....

`lsof -i -na -sTCP:LISTEN`

```
$
lsof: WARNING: compiled for FreeBSD release 12.1-RELEASE-p4; this is 12.1-RELEASE.
COMMAND    PID    USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
local-unb  859 unbound    4u  IPv6 0xfffff80044583000      0t0  TCP [::1]:domain (LISTEN)
local-unb  859 unbound    6u  IPv4 0xfffff8004457ab70      0t0  TCP 127.0.0.1:domain (LISTEN)
sshd      1127    root    3u  IPv6 0xfffff80005d603d0      0t0  TCP *:ssh (LISTEN)
sshd      1127    root    4u  IPv4 0xfffff80005d60000      0t0  TCP *:ssh (LISTEN)
sendmail  1130    root    3u  IPv4 0xfffff80005f8fb70      0t0  TCP 127.0.0.1:smtp (LISTEN)
daytimetc 1317    ippo    3u  IPv4 0xfffff800527c0000      0t0  TCP *:45501 (LISTEN)
```


```
$ telnet 127.0.0.1
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host
```

`$  cat /etc/hosts`


```
# $FreeBSD: releng/12.1/lib/libc/net/hosts 338729 2018-09-17 18:56:47Z brd $
#
# Host Database
#
# This file should contain the addresses and aliases for local hosts that
# share this file.  Replace 'my.domain' below with the domainname of your
# machine.
#
# In the presence of the domain name service or NIS, this file may
# not be consulted at all; see /etc/nsswitch.conf for the resolution order.
#
#
::1            localhost localhost.my.domain
127.0.0.1        localhost localhost.my.domain
#
# Imaginary network.
#10.0.0.2        myname.my.domain myname
#10.0.0.3        myfriend.my.domain myfriend
#
# According to RFC 1918, you can use the following IP networks for
# private nets which will never be connected to the Internet:
#
#    10.0.0.0    -   10.255.255.255
#    172.16.0.0    -   172.31.255.255
#    192.168.0.0    -   192.168.255.255
```
But ssh works fine....
`$ ] ssh 127.0.0.1`

```
The authenticity of host '127.0.0.1 (127.0.0.1)' can't be established.
ECDSA key fingerprint is SHA256:dfz/iOPCxlXOnJ4p6IGtCHE51LDjPt2pcrduta1StMI.
No matching host key fingerprint found in DNS.
Are you sure you want to continue connecting (yes/no)?
```


----------



## Jose (May 7, 2020)

Does `telnet localhost 45501` work?


----------



## ippo (May 7, 2020)

Jose said:


> Does `telnet localhost 45501` work?


I got a connection refused. Even I couldn't load the FreeBSD forum site this time the first time. 
It's like time out. 

```
$ telnet localhost 45501
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Thu May  7 23:55:06 2020
Connection closed by foreign host.
```


----------



## mark_j (May 7, 2020)

Is it firefox with dns over https?


----------



## Jose (May 7, 2020)

It actually did work.

```
Connected to localhost.
Escape character is '^]'.
Thu May  7 23:55:06 2020
Connection closed by foreign host.
```

Your daytime server returned you the time and exited. That's what it's supposed to do.

It's only listening on ipv4, and so the connection to localhost over ipv6 (::1) fails. Try `telnet 127.0.0.1 45501`. That will only try the ipv4 address.

Your server is listening on port 45501, but your client is trying to connect to port 3328. I take it you're working your way through chapter 1 of Stevens? If so examine line 14 in the listings in figure 1.5 and in figure 1.9.

Your problems reaching hosts over the Internet are probably unrelated.


----------



## ippo (May 8, 2020)

Jose said:


> It actually did work.
> 
> ```
> Connected to localhost.
> ...


 I tried this (now the server is listening on 16014)

```
$ telnet 127.0.0.1 16014
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Fri May  8 09:21:48 2020
Connection closed by foreign host.
```

I changed the port at line 14 as you said and it work!!!!!
Thanks for this insightfull and to the point help

```
$ ./daytimetcpcli 127.0.0.1
ip: 36414
ip: 127.0.0.1
ip: 0
Fri May  8 09:26:41 2020

Stream flushed.
```


----------



## ippo (May 8, 2020)

mark_j said:


> Is it firefox with dns over https?



How can I check this?


----------



## mark_j (May 8, 2020)

I'm not 100% sure, I've just read about it.
The link I could find was: https://support.mozilla.org/en-US/kb/firefox-dns-over-https

Even if it isn't the cause, it still might be worth changing your dns to another, like 8.8.8.8, to see if it helps.


----------



## SirDice (May 8, 2020)

ippo said:


> ```
> ifconfig_re0="DHCP"
> ifconfig_re0_ipv6="inet6 accept_rtadv"
> local_unbound_enable="YES"
> ```


What's in /etc/resolv.conf?


----------



## ippo (May 8, 2020)

SirDice said:


> What's in /etc/resolv.conf?




```
$ cat /etc/resolv.conf
# Generated by resolvconf
search lan
# nameserver 192.168.1.1
# nameserver fd60:78c0:18d6::1

nameserver 127.0.0.1
options edns0
```


----------



## ippo (May 8, 2020)

Sometimes,  I can load google.com sometimes not. 

```
If that address is correct, here are three other things you can try:

    Try again later.
    Check your network connection.
    If you are connected but behind a firewall, check that Firefox has permission to access the Web.
```


----------



## SirDice (May 8, 2020)

Try removing that `options edns0` from resolv.conf, see if that helps.


----------



## ippo (May 8, 2020)

SirDice said:


> Try removing that `options edns0` from resolv.conf, see if that helps.


Looks better now. But I haven't tested fully as I am doing some programming now. I will see until the end of the day.


----------



## ippo (May 8, 2020)

It seems all issues have been resolved. I would like to thank all people here in this thread.

Sorry, I have to make an edit. Mozilla's problem persist. After a time it stays idle the problem reappears.
But Opera seems to be working fine.  Anyway. All good.


----------



## Lamia (May 9, 2020)

Heaven knows why Mozilla products are acting very strangely these days. Browser on phone too slow to continue using it, browser on PC throws SSL error very rapidly and frequently because of Squid SSL Splicing/Transparent SSL whereas "Google" Chrome just works. 

Check your browser config, disable some settings e.g. DNS-over-HTTPs and a few others to test. You may also switch from one variant to the other variant of the browser - Developers, Nightly, Standard, Enterprise versions. Each has varying level of privacy, security, protection and many more. And if it is on mobile, there is fennec (which is good but troublesome ATM) and many more.


----------



## mark_j (May 9, 2020)

Probably because Mozilla has, as of late,  been more focused on eye-candy and making their browser look like a native Windows 10 app to actually worry about performance?


----------



## Lamia (May 9, 2020)

mark_j said:


> Probably because Mozilla has, as of late,  been more focused on eye-candy and making their browser look like a native Windows 10 app to actually worry about performance?


Ohh my beloved Moz+Fox+zilla!


----------



## ippo (May 9, 2020)

Lamia said:


> Heaven knows why Mozilla products are acting very strangely these days. Browser on phone too slow to continue using it, browser on PC throws SSL error very rapidly and frequently because of Squid SSL Splicing/Transparent SSL whereas "Google" Chrome just works.
> 
> Check your browser config, disable some settings e.g. DNS-over-HTTPs and a few others to test. You may also switch from one variant to the other variant of the browser - Developers, Nightly, Standard, Enterprise versions. Each has varying level of privacy, security, protection and many more. And if it is on mobile, there is fennec (which is good but troublesome ATM) and many more.



Well, I am now using Chromium but I will try to play with the settings of Mozilla. I thought Mozilla is more reliable but it seems there is an issue with the browser from the inventors of Rust. How is Rust going?


----------



## Lamia (May 10, 2020)

ippo said:


> Well, I am now using Chromium but I will try to play with the settings of Mozilla. I thought Mozilla is more reliable but it seems there is an issue with the browser from the inventors of Rust. How is Rust going?


Rust is going well. We can now build it & Firefox on Poudrière. Mozilla had a good browser back then in the days of Gecko/XULrunner. But the administrative decision not to invest in its maintenance like other products led to today's problem.


----------



## Jose (May 10, 2020)

Writing this on Firefox, but yeah, they're becoming more and more annoying. It seems I have to turn off more and more useless, privacy-invading misfeatures with every release.

I loved Firefox Klar from F-Droid on my phone, but they broke that too, of course: https://gitlab.com/fdroid/fdroiddata/-/issues/1897


----------



## mark_j (May 11, 2020)

As much as I hate to use google's spyware, it is so much faster than firefox's spyware.
Bring back lynx domination and death to javascript.


----------

