While people expect not having to type the www., most web servers will add it once you connect to them because that is its canonical name. Try it with google; typing google.com into your browser takes you to www.google.com.
But try this: configure your web server to accept www.example.com and example.com as acceptable names, with example.com as the canonical name, i.e. for Apache2:
ServerName example.com
ServerAlias www.example.com
Then, for a hosted DNS setup, configure your DNS for the domain so that the @ record is an A record with your IP address and www record is a CNAME for example.com.
If you're using bind text config files, try something like this to use the same host at IP 1.2.3.4 as the www server and domain origin:
$ORIGIN .
$TTL 43200 ; 12 hours
example.com IN SOA ns.example.com. root.example.com. (
201511496 43200 7200 604800 3600 )
$TTL 604800 ; 1 week
NS ns1.example.com.
A 1.2.3.4
$ORIGIN example.com.
# web server is hosted on same host as domain origin
www CNAME example.com.
To then FORCEFULLY redirect www.example.com to example.com regardless of what the user expects, use a rewrite rule in your web server. For example, in Apache2:
RewriteCond %{HTTP_HOST} !^example\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/(.*) http://example.com/$1 [L,R]
For further Apache2 rewrite examples and for non-port 80 hosts, see https://httpd.apache.org/docs/2.4/rewrite/remapping.html