DNS for Mail service.

I want to use java to send mail by smtp service.
but for some hosts, the InetAddress class can't find out
the ip address for the hosts, which need the MX flag in
DNS Query data package(UDP).
I can send the query and get the result from the ISP
DSN server, but the replay UDP data is quit complex,
I have not find a simple way to get the IP address from
the UDP data.
Can any one help me? Or Are you doing the same thing
like that ? We can talk about it together.
Thanks
Scott

HI Duker,
I tred to use ur way.
in the following code,
an excpetion thrown .like
"javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.dns.DnsContextFactory. Root exception is java.lang.ClassNotFoundException: com.sun.jndi.dns.DnsContextFactory"
And I try to find the related classes in the libs,
but can not find it,so I can not get any related document about the usage of the related classes.
Can you give me more help?
Regards.
Scott
<code>
package dnstest;
import java.util.*;
import javax.naming.*;
import javax.naming.directory.*;
public class dns_t {
public static void main(String[] args) throws NamingException{
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.dns.DnsContextFactory");
props.put(Context.PROVIDER_URL, "dns://ns1.dns.com/thedomain.com");
DirContext ictx = new InitialDirContext(props);
Attributes attrs1 = ictx.getAttributes("www", new String[] {"A"});
Set st = attrs1.keySet();
Iterator it = st.iterator();
NamingEnumeration it=attrs1.getAll();
while (it.hasMoreElements()) {
System.out.println((String)it.nextElement());
Hi,
You could try the JNDI-DNS early access service
provider, it is basically a provider for the JDNI api
that allows you to query a given DNS server.
Checkout
http://developer.java.sun.com/developer/earlyAccess/jnd
/#DNS
The below code is a simple test that looks up the IN A
record for www.thedomain.com
import java.util.*;
import javax.naming.*;import javax.naming.directory.*;
>
public class DnsTest {
public static void main(String[] args) {
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.dns.DnsContextFactory");
props.put(Context.PROVIDER_URLURL, "dns://ns1.dns.com/thedomain.com");
DirContext ictx = new
x = new InitialDirContext(props);
Attributes attrs1 = ictx.getAttributes("www",
("www", new string[] {"A"});
Set st = attrs1.keySet();
Iterator it = st.iterator()
while (it.hasNext()) {
System.out.println((String)it.next());
Hope this helps
Duke Ronlund
CoreJ.com
I want to use java to send mail by smtp service.
but for some hosts, the InetAddress class can'tfind
out
the ip address for the hosts, which need the MXflag
in
DNS Query data package(UDP).
I can send the query and get the result from theISP
DSN server, but the replay UDP data is quitcomplex,
I have not find a simple way to get the IP address
from
the UDP data.
Can any one help me? Or Are you doing the samething
like that ? We can talk about it together.
Thanks
Scott

Similar Messages

  • DNS for Mail service Virtual Domains

    On a server primarily running as a Mail server with 10.6.3 (DNS and OD also running)
    If host name is mail.domain.com and
    if mail service has a virtual domain virtualdomain.com,
    in the DNS setup, virtualdomain.com should have an MX record like mail.virtualdomain.com and either an A record pointing to the IP of mail.domain.com OR a CNAME pointing to mail.domain.com?
    When setting to the CNAME, DNS logs says:
    "25-May-2010 11:47:52.610 zone virtualdomain.com/IN/com.apple.ServerAdmin.DNS.public: virtualdomain.com/MX 'mail.virtualdomain.com' is a CNAME (illegal)"
    but if I set to an A record pointing to the IP, isn't there a PTR conflict with the mail.domain.com pointing to the same IP?

    SMTP requires an A or AAA as the required response for the box named in an MX.
    Your MX for the domain or subdomain would/should/must aim at an A or AAA.
    Not a CNAME. That's considered illegal.
    Yes, random domains can all have their respective MX records pointing to the same mail server. So long as the mail server has an A or AAA record. And that mail server itself is expected to be configured to accept mail for those domains for local delivery, or as part of a relay.

  • DNS configuration behind a router for Mail Services

    I am in the beginning stages of trying to set-up a test ground for a local mail server. I am playing with OS X servers DNS functions. I am new to DNS and am having slight trouble.
    What I want to do is have OS X DNS point to another server that is on my nat for mail exchange (it is a suse linux box running kerio).
    My current set-up is:
    internet --> Router for internal NAT --> OS X server is behind this nat on an IP of 10.100.251.10, the suse box is on 10.100.251.11
    I have set-up a primary zone: ns1.domain_x.com with a server IP being that of my internet static IP (supplied by my ISP).
    I have opened the necessary ports on my router (53) to point to the os x server box for DNS serving.
    My problem is.. I need to setup a mail exchange (mail.domain_x.com) record that points to the 10.100.251.11 box.
    When I do this and the global DNS servers update, a host lookup will point mail.domain_x.com to 10.100.251.11
    Which obviously is not right.
    am i missing a concept here?
    the dns server and the mail exchange I want to run are being running on the same Internet IP address, just behind a nat that the os x server is not controlling.
    any suggestion would be appreciated.. TIA

    The MX data/pointers is only needed for server to server mail exchange so that is no problem.
    (If the DNS and the mailserver are supposed to use the same public IP but run on different NATed IPs/machines you forward the traffic to the different NATed IPs based on portnumbers in your Internet router/firewall.)
    The problem I think is the mailserver finding itself on the right IP for the public IP domainname.
    I guess the easiest way to do it would be to have two DNS machines: one for public and one for private IPs.
    The private IP DNS would serve the mailserver and the internal NATed network, if you are using the same domainname internally.
    Or (as the one with the public IP data is NATed), maybe BIND views can be used to serve different zonefiles for the same domainname depending on wether the DNS lookups comes from Internet and/or the NAT router gw LAN IP or if they come from any other NATed LAN IP.
    Or maybe having only a hostfile with the private address for the same domainname would suffice on the mailserver and also using the ISP's DNSes for finding other public IP mailservers on it.
    That wouldn't fix finding the mailserver (using the same domainname) from other machines on the NATed LAN though.

  • Set up secondary DNS for mail?

    When I first configured my server using the advance setup, I successfully setup my DNS services using a domain name for the primary zone that is not a registered domain. I have no intention of ever using the domain name I use internally on the net.
    I usually host my mail services with third-party hosting company and just use my server for file and print services. However, I recently purchased a new domain name and have considered using the mail services to host the domain. My question is:
    Do I need to setup a secondary zone for this domain, or should I start over and reconfigure my server? I had read that once you configure your primary DNS, it is hard to go back and reconfigure it.
    Also, once I have the DNS properly configured, it is my understanding that I'll just need to point the MX records at my hosting company towards my server to make it work, correct?

    If you're just looking for mail then there's no need to start from scratch - you can just tell the mail server to accept mail for your new domain in addition to the existing domain.
    Before you do this, though, make sure you have a) a static IP address and b) working reverse DNS for your IP address. If you don't have this then remote mail servers may not accept your mail since you look like a spammer.
    Apart from that, once you setup postfix to accept mail for your new domain then, yes, all you need to do is change your MX records.

  • Dns for web service

    Hi there.
    I have set up web services on my server, and it is working fine. I have also setup the DNS on the server and that is working fine as well.
    Problem I have is I have Kerio Mailserver running on my server which uses port 80 for the webmail so I needed to move the wiki off that port and onto another.
    What I need to do now is set up a dns recored to point to the wiki which will be called intranet.example.com
    As far as I can tell I need to set up a (SRV) recored which then lets me choose which port to point at.
    So at the moment I have the following information in the SRV recored.
    Service Name: intranet
    Service type: http.tcp
    Host: example.com
    Port: 8045
    Priority:0
    Weight:0
    TXT: path=/
    8045 being the port I have put the wiki onto. I have tried other ports with the same result. Am I missing something. Has any body done this before and have it working.
    I am using os x server 10.5.7
    Thanks

    If you only have one network interface on the box, you just may wish to setup another IP on that interface and assign that to your webserver and then config web services in Server Admin, your httpd.conf, and your DNS for that IP. If you have the ability to add another NIC to the server that would also be a good choice.

  • Configuring Server DNS for Mail on Google Apps

    I'm trying to configure the DNS on my Snow Leopard Server for mail.mydomain.com to point to Google for Google Apps mail hosting.
    I thought I could go into mydomain.com and put an alias record to point to ghs.google.com, but that's no longer working. Any ideas of how to get around this? Is there something else I'm doing wrong?

    I figured out the problem. It had to do with an alias record hanging up the DNS.

  • Adjusting AP Payment terms to allow for mail service

    I am interested in adjusting the Accounts Payable process to release payments earlier than the payment terms (e.g. Net 30 payment would release for payment on 28th day) to allow for postal delays.  Is that possible on across the board for all payees?

    Hi Chris
    In the automatic payment run(F110), in the parameters tab -> input a date which is two days ahead in the filed 'Customer items due by' and input todays date in the field 'Docs entered up to'
    Ex: If the item is due on Sep 14 then input details as below
    Docs enetered up to: 09/12/2014
    Customer items due by: 09/14/2014
    System will pick up all items due as of Doc entered up to date + till the date in Customer items due by.
    Run the payment run the above inputs and check if the next few days due items are pulled into or not.
    Thanks,
    Sekhar

  • Simple question; Mac Server Setup for Mail, iCal and Address Book Services.

    Hi Guys;
    I'm new to the Mac Server world and need a few questions answered.
    I have purchased a new Mac mini Server for hosting File, Web, Mail, iCal and Address Book Services.
    I’m comfortable setting up File and Web Services however I’m a bit uneasy setting up Mail, iCal and Address Book services to be access locally and remotely(via the internet).
    My current setup is;
    Internet connection (Dynamic IP) -> Router -> Mac mini Server.
    I have purchased a domain name (Thornton-net.com) from DynDns.com + a custom DNS service as I can setup my router to update my domain’s IP address automatically.
    I can access File and Web Services remotely (thortnon-net.com) perfectly without any issues via the Port Forwarding feature of the Router.
    If I setup Mail, iCal and Address Book Services -> will Mail, iCal and Address Book clients be able to access these services hosted by the server via Thornton-net.com?
    Message was edited by: Allan.Thornton

    Welcome to the forums.
    For mail services (and specifically for your outbound mail to be accepted by other mail servers) your mail server needs to have a static IP address and matching forward and reverse and MX records, or a tunnel to a static IP (with matching DNS), or you need another mail server where you have an authorized relay. Without that, your mail will be considered a spam engine, and dropped.
    Additionally, your particular tier of service with your ISP (with a static IP) will generally allow server-oriented access and server-oriented network traffic, where a residential or other tier of service (with a dynamic IP addresses) can be firewalled.
    The ISP controls the "high ground" of the network connections here, so you pretty much get to play by their rules and requirements. If they don't offer static IP, then (presuming their T&Cs permit it) you get to tunnel (via IPv6, for instance) to a tunnel broker, and receive your network traffic via that (and with matching DNS) point of presence. That could well be a tunnel for your mail at whichever your DNS provider is here, because you'll have issues with your dynamic address. (You get to sort out if they offer that.)
    Far and away the easiest approach (if you want to host this stuff yourself) is to work with the ISP. They're inherently involved in your network, and they and they alone have full control over your reverse DNS configuration.

  • SMTP  - mail service

    Hi,
    i configured the SMTP for mail service.
    I can able to send mail to our domain   ( for ex: abc.com )  - default domain
    i gave SMTP Connection as  :  mail.abc.com 
    the above scenario --- will work for me if i send mail to our default domain. but i am not able to send to yahoo, gmail.
    Please help me ...
    --- Lee

    Hi Lee,
    In the SCOT, SMTP node you need to have the SMTP server address. if you've given the sap server IP address, then revert it back.
    What Juan has already mentioned,
    "you need to make sure that the IP address of the SAP System is populated on the SMTP relay agent for the mails to leave the domain." that means you've to tell your SMTP mail admin guys to add the SAP server IP address in the relay agent.
    Regards,
    Debasis.

  • Help me with mail-service logs and options

    I've a 10.4.4 server, running for mail-service.
    After the upgrade from 10.3.9 i've no POP/SMTP Logs! That's not really a problem.
    But now i cann't change the Protocol-level of Mail in Server-Admin. I can mark "warning" or something else but if i want to save it, updates it everything and 5 sec later it shows the "critical" level (same as before)!!
    That's happen with 10.4.3! I thought in 10.4.4 maybe it's better but now i cann't change any junk settings too!!
    I tried with mailbfr diagnostics but nothing found...
    Same in system.log, no info...
    I'm lucky if anybody can help me!
    Xserve G4   Mac OS X (10.4.4)  

    This is the log folder! Which rights should they have?
    -rw-r----- 1 root admin 2618324 Feb 11 03:11 mail.log.4.gz
    -rw-r----- 1 root admin 0 Jan 8 16:04 mailaccess.log
    -rw-r--r-- 1 root wheel 529312 Dec 17 03:15 mailaccess.log.0.gz
    -rw-r--r-- 1 root wheel 323018 Feb 19 2005 mailaccess.log.1.gz
    -rw-r--r-- 1 root wheel 306151 May 13 2004 mailaccess.log.2.gz
    -rw-r--r-- 1 root wheel 272849 Apr 29 2004 mailaccess.log.3.gz
    -rw-r--r-- 1 root wheel 4465 Mar 1 05:29 monthly.out
    The System Log has:
    -rw-r----- 1 root admin 341932 Mar 17 09:13 system.log
    should the group be admin in mailaccess.log?
    How can i create a new Protocol?

  • Ddns mail service

    I am using a Mac mini server (Mountain Lion) and want to use it as web server and mail server with server.app.
    I also have my own domain name of 'scheduler.co.kr'.
    Mac mini server is connect to internet via the router's port forwarding of 80, 25...etc.
    Mac mini server IP is private like 192.168.0.x.
    The router's IP is dynamic not static.
    So I registered to the DDNS (dynamic domain name service) provider and I can configure the records of A, CNAME, MX and etc in it.
    My problem is I can not use 'Mac mini server's mail service'.
    The web service is good through wordpress and MySQL.
    But mail service is not.
    My question is followed;
    1) Should I make DNS configuration in the MAc mini server using server.app?
    2) In the case of router's dynamic IP environment, can I configure a mail service of sending and receiving using Mac mini server?
         If it is possible, how can I configure my mac mini server in DNS and Mail service feature?
    3) Should I use mac mini server With DDNS service of outside provider?
         Or can I configure all services of mac mini server.app without DDNS service?
    I want to receive the reply from the experienced or Expert.
    All the  best.

    Things are still limping along. Digging into the log files, I find the following:
    Here are some examples of error messages I see:
    Jun 22 08:23:01 mini postfix/postfix-script[1442]: fatal: the Postfix mail system is not running
    Jun 22 08:23:12 mini postfix/postfix-script[1486]: warning: damaged message: corrupt/1B1B3EA0C70
    Jun 22 08:23:12 mini postfix/postfix-script[1487]: warning: damaged message: corrupt/1E360755445
    Mailaccess.log
    Jun 22 09:02:11 mini imaps[1564]: Fatal error: tlsstartservertls() failed
    Jun 22 09:02:17 mini pop3s[1998]: Fatal error: tlsstartservertls() failed
    I am considering doing a clean install of the entire server, but I do not want to do that unless I have to. Any help would be appreciated!

  • DNS/web-server hosted off-site. How to set up Leopard server for mail?

    Hey Everyone,
    Brand new xserve with leopard server 10.5.2. Currently, Our web and DNS server for our domain,"company.com" is co-located off-site with an MX record of "mail.company.com" pointed at the static IP of the office where our mail server is. I want to replace the mail server with the xserve. With that in mind, how do I configure the DNS on the xserve during initial configuration to reflect that? Give it a self-referencing FQDN like server.company.office and see if the mail service can handle the domain hosted elsewhere?
    I'm pretty new to servers and would love be able to keep this all in Standard but I'm not afraid to jump into Advanced if need be. I've created a test domain through GoDaddy of "company2.com" with an MX record of "mail.company2.com" pointing at the IP address of the xserve. Any help would be greatly appreciated!

    Hello,
    Have a look at this blog post:
    http://blogs.adobe.com/captivate/2010/08/reporting-the-quiz-results-to-a-local-server.html
    Lilybiri

  • Set up reverse DNS for virtual mail hosting

    I need a bit of server configuation advice.
    I have a static IP and two public domains on a Snow Leopard server connected using NAT behind a firewall - with the necessary port forwarding to ensure all works. 
    1. abc.com is my primary domain on the server - server.abc.com
    2. I have xyz.com set up as a virtual domain and also as a virtual mail host
    This setup has worked well for a long time but I have found that emails to [email protected] are going missing.  If I check my mx records using one of the web based tools it show an error on the reverse dns for server.xyz.com showing a reverse DNS of server.abc.com.
    So the question - is it possible to have secondary 'virtual' DNS record on the server so reverse DNS works for the virtual mail host xyz.com?  If not how do I handle the reverse DNS problem which i think is causing some external mail server to reject mail due to the inconsistency on the reverse DNS lookup?
    Many thanks for any suggestions

    SMTP requires a DNS A record.
    A DNS A record is also known as a machine record.
    A DNS A record inherently means that forward DNS and reverse DNS will match.
    The forward translation translates the host name to the IP address.
    The reverse translation translates the IP address to host name.
    When the full translation produces the same host name, that's an A record.
    DNS CNAME records are aliases, and are used for virtual hosts.
    CNAME records inherently do not match the reverse DNS translations.
    To get your configuration to work, your server must have an A record.
    That means forward and reverse DNS will match.
    Any of the virtual hosts within your mail server then all use an MX pointing at the A record host.
    If you have your DNS hosted somewhere other than your ISP, then you'll need your ISP to set up a DNS PTR.
    The DNS PTR is the reverse translation; address to name.
    If you have your own DNS services within your network (as would be typical with a privately-addressed NAT'd network), set that up as a virtual host within SMTP.
    Here is some related reading on external (public) DNS, as related to SMTP servers and such.

  • DNS Zone for Mail

    Following on from my first question which the nice Mr Camelot answered for me
    I have a server which has a DNS zone of companyname.net.
    Internal mail has been setup using Mail Exchanger set to mail.companyname.net.
    I have checked changeip -checkhostname and there are no issues.
    The public DNS records have been set to make mail.companyname.com the MX record, and an A record for mail.companyname.com has been setup pointing to the static IP.
    As I see it I have two options I can move forward with (3 actually if I wipe the server and start again )
    1. Try and rename the DNS zone to companyname.com and then reset the mail settings to match.
    2. Setup a CNAME on the server internal DNS to point mail.companyname.com to mail.companyname.net and leave the mail settings as they are.
    I am in the process of installing SL Server on a VM to test the first option to see if it is viable, but my question is are there any options I have missed, and what would you suggest I do in this circumstance?
    TIA.

    So you have a zone for a host mail.example.net within your network, and valid external DNS services with an A record and MX at mail.example.com within your external DNS services, and you're wondering about rebuilding this all?
    It'd be far easier to just enable mail.companyname.com as a virtual host within the mail server configuration.
    Personally, I'd look to remove the use of the internal example.net MX for the mail server, and use the external path.  You can set up the MX for the internal network to resolve to mail.example.com, for instance.  With that (and with a firewall that knows how to reflect" outbound traffic for the WAN IP address, or - somewhat uglier - adding a DNS A record for the mail.example.com within your internal zone), the configuration is the same for all hosts, whether internal desktops or mobile devices.
    Note that the companyname.com and companyname.net domains are real and registered domains.   The domains example.com, example.net and example.org are RFC-reserved for documentation and for these sorts of postings.

  • Dns setting require for mail server 2013

    Hello Support,
    I have install exchange server 2013 and working fine but right now i have some change in DNS server record and my mail services stop. what record add to start my mail services ( sent and received). till now exchange server mail box give the error mail not
    connected with server. Please revered ASAP.   

    couple of things to notice. if you saying your exchange services stopped... this wont happen because of DNS or are you saying you exchange is not working/mail flow.
    now i would suggest to quickly check the mail services. run a test for inbound and outbound at exrca.com there you will have the proper answer that what you have missed.
    and at last.. for DNS.. you need MX and A record for your email server for basic functioning .. and for autodiscover couple of more. lets verify the MX and A record first and then verify the send and receive connector. to verify MX do a Nslookup as below
    >cmd
    >nsloookup   {This should resolve to your local DNS if you running this from exchange server, which is recommended and should not time out}
    >set type=mx
    > your-domain.com {This should result "A" record / FQDN of your mail server}
    > set type=A {To verify the above FQDN should point to right IP}
    > mail.your-domain.com [assuming that in MX output you got mail-your-domain.com]
    > 1.1.1.1  [IP of your email server]
    if you are able to verify above then your chances are you dont have issue with DNS.
    Make sure from oursite you are able to telnet t tour exchange server on port 25 and from inside you are able to resolve names from your exchange server and also have internet access.if you able to verify till this point then its the turn now to verify send
    and receive connector. one easy way is exrca.com and then share the results.
    to verify if your exchange is configured properly please follow this link.
    http://www.techieshelp.com/exchange-2013-step-by-step-configuration/                                            
    MARK AS USEFUL/ANSWER IF IT DID
    Thanks
    Happiness Always
    Jatin

Maybe you are looking for

  • Color coding in the "Date" and "Time" field in "Person Assignment"

    Hi, What does it mean when the color of the values for the "Date" and "Time" fields under the tab "Person Assignment" on an activity element in the project builder (CJ20N) turn red? Regards, Petter Kvalvik

  • Connecting IPhone 5s to Samsung TV

    I have the right adappter It works on a similar TV. On this TV it tells me " Mode not Supported".

  • 9i on Linux. Problems with Temp tablespace cleanup

    I am currently running Oracle 9i Enterprise on SUSE Linux 7.2. I am executing queries against the new XMLType datatype and every query adds to the Temp tablespace, which doesn't get cleaned up. Eventually, the tablespace will run out of space and Ora

  • Multiple master regions for single detail

    I am trying to created a master / detail with spry. the problem is that I need to have the master area grouped in three different sections separated by titles and each title would have styling including background image. I can think of two different

  • EP6 SP9 - 'Personalize Portal' link does not work

    Hi, We've just installed EP6 SR1 SP9 and applied patch 4. The portal seems to work fine, except for one thing: The 'Personalize' link on the top right, above the TLN, doesn't seem to work. When clicking the link, nothing happens. No popup, no error m