Cannot send test email - DNS problem?

Status
Not open for further replies.

antiartist

Cadet
Joined
Dec 5, 2012
Messages
6
Cannot send a test email from the general settings menu. The error is:
Code:
Your test email could not be sent: [Errno 8] hostname nor servname provided, or not known


My ISP is Telus (Canada) and so I'm using their SMTP address. To use the relay, you have to be on their network (which I am) and as such, they do not require authentication credentials:
Code:
 smtp.telus.net:25  


From the FreeNAS shell, I can successfully ping both the IP address and freenas.local and just "freenas".

From Windows shell (on a seperate computer within the local network) I can successfully ping the freenas IP address, "freenas" but NOT freenas.local

In the Freenas Global Configuration, I have tried leaving the Nameserver field blank and using the telus nameservers*

I did a reverse IP lookup of smtp.telus.net and found the IP address to be 199.185.220.249
Replacing the smtp hostname with the IP address and testing, I get a new error:
Code:
Your test email could not be sent: [Errno 51] Network is unreachable


Soooooooo....I have a DNS issue?

Before posting this, I have definitely searched through this forum looking for an answer. While I'm certainly not the only person that has had this problem, the threads I did find are either specific to gmail smtp settings (which doesn't apply here) or the problem magically fixes itself (which has yet to happen!).

Your help is appreciated!
 

bollar

Patron
Joined
Oct 28, 2012
Messages
411
This is just a guess: Do you have the IPv4 Default Gateway defined in Network: Global Configuration ?
 

antiartist

Cadet
Joined
Dec 5, 2012
Messages
6
Nope, there is no IPv4 Default Gateway defined in Network: Global Configuration. I don't want freenas accessible outside of the local network at all.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Don't you kind of require a gateway in order to route the traffic? As for being accessible or not from the outside world, that is what a firewall is for in your router (assuming you have one).
 

bollar

Patron
Joined
Oct 28, 2012
Messages
411
Yeah. I think you'll find that if you set the default gateway to your network's gateway that email will work. You might as well try it for a moment and see. When I tested here just now, I found that I couldn't send email unless the gateway was defined.
 

bollar

Patron
Joined
Oct 28, 2012
Messages
411

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
That's a good guess, bollar. Also, probably don't supply the port along with "smtp.telus.net"... just an offhand guess
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
I think this concern is caused by the documentation: Default Gateway - typically not set to prevent NAS from being accessible from the Internet

That should probably be rephrased.

Not to mention it being completely wrong. Not setting the default gateway means that the NAS cannot send traffic to the Internet. The Internet can still address the NAS. An attacker may be able to generate spoofed traffic from the Internet addressed to the NAS as well. While unlikely, falls well outside the definition of "prevent". Most average users are saved because they're behind NAT.

Changing ... edited. Tell me what you guys think of the changes to the doc page. Criticism welcome, suggestions for improvement even more welcome.
 

bollar

Patron
Joined
Oct 28, 2012
Messages
411
Changing ... edited. Tell me what you guys think of the changes to the doc page. Criticism welcome, suggestions for improvement even more welcome.

I understand what you wrote. I just added a "see note below" to the table to nudge the reader to see the complete explanation of why they might or might not want to set the gateway.
 

antiartist

Cadet
Joined
Dec 5, 2012
Messages
6
Ok, I specified the default gateway and the test email went through successfully. And that change to the documentation makes the matter much clearer. I've learned a little bit more about networking today :p
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I followed the link and it tells me there is no text on that page.
 

antiartist

Cadet
Joined
Dec 5, 2012
Messages
6
Alright, I noticed I stopped getting system emails today and went back to send another test email...sure enough, it's not working again and I'm getting the same error as before. If I change the smtp.telus.net to the corresponding IP address, the test send is successful. This was not happening last week and the only change I've made to the system is adding another user.

The IPv4 gateway ~is~ still specified. Thoughts?
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
My thoughts.. something changed and you don't know what. I don't necessarily mean in FreeNAS. For instance, someone unplugged a network cable to untangle it and then plugged it back in somewhere else, someone changed router settings, etc.

SOMETHING has changed. I think once you figure out what has changed that will point you in the right direction.

Note that you want this to be fixed and not use the IP address. NTP data won't work either as well as some other stuff(I can't remember exactly...too tired).
 

antiartist

Cadet
Joined
Dec 5, 2012
Messages
6
Using the FreeNAS shell, I wasn't able to ping my smtp host, google.com and a variety of other sites outside of my local network but using IP addresses does ping ok. So it's a DNS problem. I have the IPv4 default gateway set in FreeNAS to be my router, which has DHCP enabled. My understanding is that the domain name resolving is therefore handled by the router. So I don't understand what the problem could be since my computer (on the same LAN) is resolving just fine.

As a workaround, I tried specifying my ISP's dns servers manually using the nameserver fields in Global configureation, but those fields don't accept non-IP addresses (ie: ns1.dns.telus.com) so that workaround was a bust.

Solution: set FreeNAS to use Google's public DNS servers instead (8.8.8.8 and 8.8.4.4) :)
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
My understanding is that the domain name resolving is supposed to be handled by the router.

Fixed that for ya. My guess is your router isn't doing its job correctly. Generally the 3 common problems people haev with DNS resolution:

1. Didn't put the gateway in correctly.
2. They're running multiple subnets and don't understand what they are doing and how to do it.
3. Router issues.
 

antiartist

Cadet
Joined
Dec 5, 2012
Messages
6
I'll be damned, there was a conflicting subnet set in the router. After correcting it, it now works as it should. Thanks for the help!:D
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I'll be damned, there was a conflicting subnet set in the router. After correcting it, it now works as it should. Thanks for the help!:D

So basically a little of #2 and #3. :P
 

PenalunWil

Contributor
Joined
Dec 30, 2013
Messages
115
Yeah. I think you'll find that if you set the default gateway to your network's gateway that email will work. You might as well try it for a moment and see. When I tested here just now, I found that I couldn't send email unless the gateway was defined.

I was struggling with the same issues as Antiartist and spent weeks looking through the forum for the answer only to come across this post and insert my router's IP address (not the Public one) in the default gateway. I presume that my NAS and the two other computers attached to my router along with my Galaxy Tab and phone via wifi are all hiding behind my routers NAT so everything is safe... well as safe as can be expected. I can ping from one device to the other and all is fine.

I've tested my e-mail and that works. My SMART monitoring and testing is set up "a la" Cyberjocks schedule and I've recently started using the FreeNAS shell to look at my hard drives.

I was wondering how many other noobs (like me :D) out there are typing there computers IP address into the default gateway when they should actually be inserting their router's IP address?
Would it be a good idea to mention that the router's IP address should be typed into the default gateway in a sticky? (thinks... perhaps it already is and I missed it...:oops:)
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Few things I'd like to say about your post...

1. Your server *really* should be behind the NAT. If it's not that's kind of... scary. If you are using DHCP, your router *should* provide the proper gateway. If you are using static IPs set in the WebGUI (not to be confused with static IPs set from your DHCP server.. most likely your router) then you'll have to provide the gateway.
2. Gateways aren't always routers in a home environment. The field is for the gateway for the subnet, and that's why its called the gateway. Not to sound demeaning, but it makes me shiver a little to see people not understand gateways because that's one of the fundamentals to networking. I'm hesitant to say it, but if you don't understand gateways you probably have much bigger problems you are unaware of than just a gateway field. I've seen people that claim to have 10+ years in IT and not understand gateways and they just start throwing stuff in the fields until it works or they run out of patience and pay someone else to have the answer. But it's really more of an understanding of networking than just a "router's IP goes here" type of thing. The field is called what it is.. the gateway.
3. More than likely your phones, tablets, and other machines on your network are using DHCP to get their network settings and that *should* include the gateway. I actually use my router to set all of the static IPs in my house and all of my machines are set to DHCP. I do that because if my gateway had to change tomorrow I can easily change it in one place. I can also change all of the IPs on my LAN from a single place, etc. In my opinion DHCP makes this so easy that static IPs are unnecessary for home use. Unfortunately though, if your DHCP server goes down, the whole network goes down too.
 

PenalunWil

Contributor
Joined
Dec 30, 2013
Messages
115
I ran the ipconfig in my cmd to check my default gateway which is correct. I'm letting my router's DHCP throw out the IP address to anyone that's connected to my LAN. I'm also definitely behind the router's NAT.

I plan to get a managed switch at some point and set up a vlan for my office equipment and a vlan for the rest of the house.
 
Status
Not open for further replies.
Top